Skip to contentSkip to conversation

6 memory leaks

CHECKER Jean Tourrilhes 2 participants 2 messages Apr 21, 2003

lore
Share & tools
lore
#0 lore raw
Quoted 11 lines · William Lee Irwin III
Quoted 9 lines · Muli Ben-Yehuda

Index: net/irda/irttp.c
===================================================================
RCS file: /home/cvs/linux-2.5/net/irda/irttp.c,v
retrieving revision 1.12
diff -u -r1.12 irttp.c

irda/irttp.c +0 -0
@@ -263,7 +263,7 @@
 
Quoted 7 lines

irda/irttp.c line 269

Quoted 7 lines
irda/irttp.c +1 -1
 	IRDA_DEBUG(2, "%s(), rx_sdu_size=%d\n",  __FUNCTION__,
 		   self->rx_sdu_size);
-	ASSERT(n <= self->rx_sdu_size, return NULL;);
+	ASSERT(n <= self->rx_sdu_size, {dev_kfree_skb(skb); return NULL;});
 
 	/* Set the new length */
 	skb_trim(skb, n);

Thanks for the heads up. I'm preparing a massive skb leak
patch for 2.5.X, I'll slip that into it. I'll probably code that differently so that it looks "cleaner".
By the way, this is not terribly important, as if ASSERT do
trigger we usually have bigger problems than memory leaks (like you may want to reboot rather sooner than later).

Quoted 4 lines

I'm in terror. ASSERT()? return NULL in a macro argument? Any chance of cleaning that up a bit while you're at it?

-- wli

Rather than fixing imaginary non-existing bugs, I prefer to
spend my time fixing real bugs that byte real users. This construct is perfectly sound and valid, and it needs to be done in this way, the only issue is that someone should rename "ASSERT" into "IRDA_ASSERT".

	Have fun...

	Jean
#1 lore raw
Quoted 2 lines · William Lee Irwin III
Quoted 2 lines

I'm in terror. ASSERT()? return NULL in a macro argument? Any chance of cleaning that up a bit while you're at it?

Quoted 4 lines · Jean Tourrilhes

Rather than fixing imaginary non-existing bugs, I prefer to
spend my time fixing real bugs that byte real users. This construct is perfectly sound and valid, and it needs to be done in this way, the only issue is that someone should rename "ASSERT" into "IRDA_ASSERT".

The construct is a Lovecraftian horror. I've already lost my lunch once over extremely disgusting code today, and I don't care to intentionally read or run IRDA code ever again.

-- wli