提交 355a8031 编写于 作者: D Damien Le Moal 提交者: Jens Axboe

libata: fix ata_host_start()

The loop on entry of ata_host_start() may not initialize host->ops to a
non NULL value. The test on the host_stop field of host->ops must then
be preceded by a check that host->ops is not NULL.
Reported-by: Nkernel test robot <lkp@intel.com>
Signed-off-by: NDamien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: NHannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.comSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 3ad4a316
......@@ -5573,7 +5573,7 @@ int ata_host_start(struct ata_host *host)
have_stop = 1;
}
if (host->ops->host_stop)
if (host->ops && host->ops->host_stop)
have_stop = 1;
if (have_stop) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册