Re: [PATCH 1/1] staging: gdm72xx: fix an skb memory leak

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 27, 2012 at 12:22:20AM +0200, Javier Martinez Canillas wrote:
> The NLMSG_PUT() macro contains a hidden goto that jumps to the
> nlmsg_failure label. Since the sk_buff was allocated before the macro,
> jumping to the nlmsg_failure label leaks the memory allocated for it.
> 
> Calling kfree() before returning would fix it, but is better to avoid
> using this error prone macro and use nlmsg_put() instead.
> 
> Also, use nlmsg_data() instead of NLMSG_DATA() to check type.
> 
> Signed-off-by: Javier Martinez Canillas <javier@xxxxxxxxxxxx>
> ---
> 
> It just was compiled tested since I don't have the hardware

Nice, thanks for doing this, that's a nasty macro :)

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux