[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20111123002553.729423242@clark.kroah.org>
Date: Tue, 22 Nov 2011 16:25:09 -0800
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: torvalds@...ux-foundation.org, akpm@...ux-foundation.org,
alan@...rguk.ukuu.org.uk, Jesper Juhl <jj@...osbits.net>,
Dan Williams <dcbw@...hat.com>,
"John W. Linville" <linville@...driver.com>
Subject: [09/53] Net, libertas: Resolve memory leak in if_spi_host_to_card()
3.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jesper Juhl <jj@...osbits.net>
commit fe09b32a4361bea44169b2063e8c867cabb6a8ba upstream.
If we hit the default case in the switch in if_spi_host_to_card() we'll leak
the memory we allocated for 'packet'. This patch resolves the leak by freeing
the allocated memory in that case.
Signed-off-by: Jesper Juhl <jj@...osbits.net>
Acked-by: Dan Williams <dcbw@...hat.com>
Signed-off-by: John W. Linville <linville@...driver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
drivers/net/wireless/libertas/if_spi.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/net/wireless/libertas/if_spi.c
+++ b/drivers/net/wireless/libertas/if_spi.c
@@ -999,6 +999,7 @@ static int if_spi_host_to_card(struct lb
spin_unlock_irqrestore(&card->buffer_lock, flags);
break;
default:
+ kfree(packet);
netdev_err(priv->dev, "can't transfer buffer of type %d\n",
type);
err = -EINVAL;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists