diff options
author | Damien Le Moal <damien.lemoal@wdc.com> | 2021-08-16 10:44:47 +0900 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-09-15 09:47:27 +0200 |
commit | 1c189ccef0cfaf292a816f9abcc7a1b11fe094c6 (patch) | |
tree | de0eb261fdc93f287849f60630c0a634e25a630f /drivers/ata/libata-core.c | |
parent | e55b627d6e1f13ee73ec3525f1e4ff0b48a85453 (diff) | |
download | linux-stable-1c189ccef0cfaf292a816f9abcc7a1b11fe094c6.tar.gz linux-stable-1c189ccef0cfaf292a816f9abcc7a1b11fe094c6.tar.bz2 linux-stable-1c189ccef0cfaf292a816f9abcc7a1b11fe094c6.zip |
libata: fix ata_host_start()
[ Upstream commit 355a8031dc174450ccad2a61c513ad7222d87a97 ]
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: kernel test robot <lkp@intel.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/ata/libata-core.c')
-rw-r--r-- | drivers/ata/libata-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index f67b3fb33d57..7788af0ca109 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6394,7 +6394,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) { |