mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [Patch] Memory leak in drivers/net/irda/via-ircc.c
@ 2006-06-21 15:07 Eric Sesterhenn
  0 siblings, 0 replies; only message in thread
From: Eric Sesterhenn @ 2006-06-21 15:07 UTC (permalink / raw)
  To: linux-kernel

hi,

this was spotted by coverity (id #653). whenever (len-4<2) we
leak the allocated skb. 

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>

--- linux-2.6.17-git2/drivers/net/irda/via-ircc.c.orig	2006-06-18 03:49:35.000000000 +0200
+++ linux-2.6.17-git2/drivers/net/irda/via-ircc.c	2006-06-21 17:02:13.000000000 +0200
@@ -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-06-21 15:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-21 15:07 [Patch] Memory leak in drivers/net/irda/via-ircc.c Eric Sesterhenn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®