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 <[email protected]>
> ---
> 
> 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
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to