提交 c59074aa 编写于 作者: Z Zhang Changzhong 提交者: Xie XiuQi

adm8211: fix error return code in adm8211_probe()

stable inclusion
from stable-5.10.4
commit bfe3dcabb9a056145a3c22c995846695d12ea785
bugzilla: 46903

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

[ Upstream commit 05c2a61d ]

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: cc0b88cf ("[PATCH] Add adm8211 802.11b wireless driver")
Reported-by: NHulk Robot <hulkci@huawei.com>
Signed-off-by: NZhang Changzhong <zhangchangzhong@huawei.com>
Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1607071638-33619-1-git-send-email-zhangchangzhong@huawei.comSigned-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NXie XiuQi <xiexiuqi@huawei.com>
上级 86e85c9e
无相关合并请求
......@@ -1796,6 +1796,7 @@ static int adm8211_probe(struct pci_dev *pdev,
if (io_len < 256 || mem_len < 1024) {
printk(KERN_ERR "%s (adm8211): Too short PCI resources\n",
pci_name(pdev));
err = -ENOMEM;
goto err_disable_pdev;
}
......@@ -1805,6 +1806,7 @@ static int adm8211_probe(struct pci_dev *pdev,
if (reg != ADM8211_SIG1 && reg != ADM8211_SIG2) {
printk(KERN_ERR "%s (adm8211): Invalid signature (0x%x)\n",
pci_name(pdev), reg);
err = -EINVAL;
goto err_disable_pdev;
}
......@@ -1815,8 +1817,8 @@ static int adm8211_probe(struct pci_dev *pdev,
return err; /* someone else grabbed it? don't disable it */
}
if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(32)) ||
dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) {
err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (err) {
printk(KERN_ERR "%s (adm8211): No suitable DMA available\n",
pci_name(pdev));
goto err_free_reg;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
新手
引导
客服 返回
顶部