libata: fix ata_host_start()
authorDamien Le Moal <damien.lemoal@wdc.com>
Mon, 16 Aug 2021 01:44:47 +0000 (10:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 09:42:58 +0000 (11:42 +0200)
commit5e17558f645f27c2a0b0f5c87b5396424dc0545b
tree481cd9c085c0728a0755aff4a8fd9c23e4ebafe6
parent1432cb4d9b107bf178374c443943870cdc2c40f3
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>
drivers/ata/libata-core.c