提交 66aff0d4 编写于 作者: Z Zheyu Ma 提交者: Zheng Zengkai

ata: sata_mv: Fix the error handling of mv_chip_id()

stable inclusion
from stable-5.10.77
commit 5aa5bab579575452bc59f9626e1cd44b4cfbd373
bugzilla: 185677 https://gitee.com/openeuler/kernel/issues/I4IAP7

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=5aa5bab579575452bc59f9626e1cd44b4cfbd373

--------------------------------

commit a0023bb9 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: NZheyu Ma <zheyuma97@gmail.com>
Signed-off-by: NDamien Le Moal <damien.lemoal@opensource.wdc.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 6e044079
...@@ -3892,8 +3892,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) ...@@ -3892,8 +3892,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx)
break; break;
default: default:
dev_err(host->dev, "BUG: invalid board index %u\n", board_idx); dev_alert(host->dev, "BUG: invalid board index %u\n", board_idx);
return 1; return -EINVAL;
} }
hpriv->hp_flags = hp_flags; hpriv->hp_flags = hp_flags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册