netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Ubuntu PATCH] via-ircc: fix memory leak
@ 2006-07-03 20:48 Randy Dunlap
  0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2006-07-03 20:48 UTC (permalink / raw)
  To: samuel, lkml; +Cc: akpm, netdev

From: Chuck Short <chuck@maggie>

[UBUNTU: via-ircc] Fix memory leak.

Coverity id# 653

patch location:
http://www.kernel.org/git/?p=linux/kernel/git/bcollins/ubuntu-dapper.git;a=commitdiff;h=a1f34cb68b16807ed9d5ebb0f6a6ec5ff8a5fc78

Signed-off-by: Chuck Short <zulcss@gmail.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
---
 drivers/net/irda/via-ircc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- linux-2617-g21.orig/drivers/net/irda/via-ircc.c
+++ linux-2617-g21/drivers/net/irda/via-ircc.c
@@ -1220,8 +1220,13 @@ static int upload_rxdata(struct via_ircc
 
 	IRDA_DEBUG(2, "%s(): len=%x\n", __FUNCTION__, len);
 
+	if ((len - 4) < 2) {
+		self->stats.rx_dropped++;
+		return FALSE;
+	}
+
 	skb = dev_alloc_skb(len + 1);
-	if ((skb == NULL) || ((len - 4) < 2)) {
+	if (skb == NULL) {
 		self->stats.rx_dropped++;
 		return FALSE;
 	}




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-07-03 20:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-03 20:48 [Ubuntu PATCH] via-ircc: fix memory leak Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).