adm80211: return an error if adm8211_alloc_rings() fails
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 7 Dec 2016 11:21:22 +0000 (14:21 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 5 Jun 2017 20:13:40 +0000 (21:13 +0100)
commit c705a6b3aa7804d7bc6660183f51e510c61dc807 upstream.

We accidentally return success when adm8211_alloc_rings() fails but we
should preserve the error code.

Fixes: cc0b88cf5ecf ("[PATCH] Add adm8211 802.11b wireless driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
[bwh: Backported to 3.2: adjust filename]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/wireless/adm8211.c

index f5ce562..b98323b 100644 (file)
@@ -1842,7 +1842,8 @@ static int __devinit adm8211_probe(struct pci_dev *pdev,
        priv->rx_ring_size = rx_ring_size;
        priv->tx_ring_size = tx_ring_size;
 
        priv->rx_ring_size = rx_ring_size;
        priv->tx_ring_size = tx_ring_size;
 
-       if (adm8211_alloc_rings(dev)) {
+       err = adm8211_alloc_rings(dev);
+       if (err) {
                printk(KERN_ERR "%s (adm8211): Cannot allocate TX/RX ring\n",
                       pci_name(pdev));
                goto err_iounmap;
                printk(KERN_ERR "%s (adm8211): Cannot allocate TX/RX ring\n",
                       pci_name(pdev));
                goto err_iounmap;