summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Changzhong <zhangchangzhong@huawei.com>2020-12-04 11:47:17 +0300
committerKalle Valo <kvalo@codeaurora.org>2020-12-07 19:35:43 +0300
commit05c2a61d69ea306e891884a86486e1ef37c4b78d (patch)
tree165fcbdc00df078d721572b90beca4c46d56de37
parent5e38884152bae058da7c58183c3859f98f7fe35c (diff)
downloadlinux-05c2a61d69ea306e891884a86486e1ef37c4b78d.tar.xz
adm8211: fix error return code in adm8211_probe()
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Fixes: cc0b88cf5ecf ("[PATCH] Add adm8211 802.11b wireless driver") Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1607071638-33619-1-git-send-email-zhangchangzhong@huawei.com
-rw-r--r--drivers/net/wireless/admtek/adm8211.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c
index 5cf2045fadef..c41e72508d3d 100644
--- a/drivers/net/wireless/admtek/adm8211.c
+++ b/drivers/net/wireless/admtek/adm8211.c
@@ -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;