Skip to content

Commit fc4073d

Browse files
damien-lemoalgregkh
authored andcommitted
libata: fix ata_host_start()
[ Upstream commit 355a803 ] 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>
1 parent cf619a5 commit fc4073d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/ata/libata-core.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5573,7 +5573,7 @@ int ata_host_start(struct ata_host *host)
55735573
have_stop = 1;
55745574
}
55755575

5576-
if (host->ops->host_stop)
5576+
if (host->ops && host->ops->host_stop)
55775577
have_stop = 1;
55785578

55795579
if (have_stop) {

0 commit comments

Comments
 (0)