From: Jesper Juhl Date: Wed, 11 Apr 2012 21:23:41 +0000 (+0200) Subject: can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths X-Git-Tag: v3.4-rc5~44^2~26 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a49bcabedc18319f673319d5e71b5751e3978179;p=pandora-kernel.git can: usb: PCAN-USB Pro: fix mem leaks in pcan_usb_pro_init() on error paths If either call to pcan_usb_pro_send_req() in drivers/net/can/usb/peak_usb/pcan_usb_pro.c::pcan_usb_pro_init() fails, we'll leak the memory we allocated to 'usb_if' with kzalloc() when the 'usb_if' variable goes out of scope without having been assigned to anything as we 'return err;'. Fix this by adding appropriate kfree(usb_if) calls to the error paths. Signed-off-by: Jesper Juhl Acked-by: Stephane Grosjean Signed-off-by: Marc Kleine-Budde --- Reading git-diff-tree failed