From: Damien Le Moal Date: Mon, 16 Aug 2021 01:44:47 +0000 (+0900) Subject: libata: fix ata_host_start() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5e17558f645f27c2a0b0f5c87b5396424dc0545b;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git 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 Signed-off-by: Damien Le Moal Reviewed-by: Hannes Reinecke Link: https://lore.kernel.org/r/20210816014456.2191776-3-damien.lemoal@wdc.com Signed-off-by: Jens Axboe Signed-off-by: Sasha Levin --- diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 228a4cfb0e7d..ea42840575ca 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -6213,7 +6213,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) {