can: peak_usb: fix mem leak in pcan_usb_pro_init()
commit20fb4eb96fupstream. This patch fixes a memory leak in pcan_usb_pro_init(). In patchf14e224net: can: peak_usb: Do not do dma on the stack the struct pcan_usb_pro_fwinfo *fi and struct pcan_usb_pro_blinfo *bi were converted from stack to dynamic allocation va kmalloc(). However the corresponding kfree() was not introduced. This patch adds the missing kfree(). Reported-by: Stephane Grosjean <s.grosjean@peak-system.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
c045542c68
commit
b52cc5df78
1 changed files with 3 additions and 0 deletions
|
|
@ -927,6 +927,9 @@ static int pcan_usb_pro_init(struct peak_usb_device *dev)
|
|||
/* set LED in default state (end of init phase) */
|
||||
pcan_usb_pro_set_led(dev, 0, 1);
|
||||
|
||||
kfree(bi);
|
||||
kfree(fi);
|
||||
|
||||
return 0;
|
||||
|
||||
err_out:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue