summaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorZheyu Ma <zheyuma97@gmail.com>2021-10-22 09:12:26 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-11-02 17:39:22 +0100
commit875483783c5db3c393f74110de9dfb02f741c721 (patch)
tree0a7583601cd33b7f708aee1dd048a95548c35cb2 /drivers/ata
parent5a3a5e1efd63751781a75d1e289b5319729a3b6c (diff)
downloadlinux-stable-875483783c5db3c393f74110de9dfb02f741c721.tar.gz
linux-stable-875483783c5db3c393f74110de9dfb02f741c721.tar.bz2
linux-stable-875483783c5db3c393f74110de9dfb02f741c721.zip
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>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/sata_mv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index ded3a66049d2..6007ebb80f88 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -3907,8 +3907,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
break;
default:
- dev_err(host->dev, "BUG: invalid board index %u\n", board_idx);
- return 1;
+ dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
+ return -EINVAL;
}
hpriv->hp_flags = hp_flags;