Skip to contentSkip to conversation

drivers/net/wimax/i2400m/fw.c fix possible double free

PATCH Darren Jenkins 2 participants 2 messages Mar 18, 2010 – Mar 20, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 2 lines · Inaky Perez-Gonzalez

If krealloc() fails to aallocate a new pointer, the old block is unmodified, so by doing this you are leaking a buffer allocation.

It seems you are right.
So now understanding correctly how krealloc() works I can see that the double kfree() can only actually happen if the el_size parameter to i2400m_zrealloc_2x() is zero, and it isn't at the two call sites.

So this was a false positive and I am sorry for the noise.

Darren J.

maintainer
#1 lore raw

From: Darren Jenkins <[email protected]>
Date: Thu, 18 Mar 2010 19:46:48 +1100

Quoted 7 lines
Quoted 2 lines · Inaky Perez-Gonzalez

If krealloc() fails to aallocate a new pointer, the old block is unmodified, so by doing this you are leaking a buffer allocation.

Quoted 6 lines

It seems you are right.
So now understanding correctly how krealloc() works I can see that the double kfree() can only actually happen if the el_size parameter to i2400m_zrealloc_2x() is zero, and it isn't at the two call sites.

So this was a false positive and I am sorry for the noise.

No problem, at least the code got audited :-)