diff mbox

adm80211: return an error if adm8211_alloc_rings() fails

Message ID 20161207112122.GA5686@elgon.mountain (mailing list archive)
State Accepted
Commit c705a6b3aa7804d7bc6660183f51e510c61dc807
Delegated to: Kalle Valo
Headers show

Commit Message

Dan Carpenter Dec. 7, 2016, 11:21 a.m. UTC
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>

Comments

Kalle Valo Dec. 30, 2016, 11:32 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> wrote:
> 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>
> 
> diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c
> index 2b4a3eb38dfa..098c814e22c8 100644
> --- a/drivers/net/wireless/admtek/adm8211.c
> +++ b/drivers/net/wireless/admtek/adm8211.c
> @@ -1863,7 +1863,8 @@ static int adm8211_probe(struct pci_dev *pdev,
>  	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;

Patch applied to wireless-drivers-next.git, thanks.

c705a6b3aa78 adm80211: return an error if adm8211_alloc_rings() fails
diff mbox

Patch

diff --git a/drivers/net/wireless/admtek/adm8211.c b/drivers/net/wireless/admtek/adm8211.c
index 2b4a3eb38dfa..098c814e22c8 100644
--- a/drivers/net/wireless/admtek/adm8211.c
+++ b/drivers/net/wireless/admtek/adm8211.c
@@ -1863,7 +1863,8 @@  static int adm8211_probe(struct pci_dev *pdev,
 	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;