]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ata: sata_mv: Fix the error handling of mv_chip_id()
authorZheyu Ma <zheyuma97@gmail.com>
Fri, 22 Oct 2021 09:12:26 +0000 (09:12 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 2 Nov 2021 17:26:44 +0000 (18:26 +0100)
commita36119f9b3fb069437383a8eff4e65181b6e7e2f
tree6c8222bcc0ce107fd47aa9d0d0db378b39a15472
parent78c2dc1cdf0bdfc83e473d78f23da4d2aeb98142
ata: sata_mv: Fix the error handling of mv_chip_id()

commit a0023bb9dd9bc439d44604eeec62426a990054cd upstream.

mv_init_host() propagates the value returned by mv_chip_id() which in turn
gets propagated by mv_pci_init_one() and hits local_pci_probe().

During the process of driver probing, the probe function should return < 0
for failure, otherwise, the kernel will treat value > 0 as success.

Since this is a bug rather than a recoverable runtime error we should
use dev_alert() instead of dev_err().

Signed-off-by: Zheyu Ma <zheyuma97@gmail.com>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ata/sata_mv.c