ath9k_htc: rare leak in ath9k_hif_usb_alloc_tx_urbs()
authorDan Carpenter <error27@gmail.com>
Fri, 14 May 2010 14:52:37 +0000 (16:52 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 24 May 2010 19:07:42 +0000 (15:07 -0400)
This is obviously a small picky thing.  The original error handling code
doesn't free the most recent allocations which haven't been added to the
hif_dev->tx.tx_buf list yet.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Sujith <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/ath/ath9k/hif_usb.c

index ac82911..77b3591 100644 (file)
@@ -609,6 +609,10 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
 
        return 0;
 err:
+       if (tx_buf) {
+               kfree(tx_buf->buf);
+               kfree(tx_buf);
+       }
        ath9k_hif_usb_dealloc_tx_urbs(hif_dev);
        return -ENOMEM;
 }