Re: [PATCH] net: kalmia: fix memory leaks

From: David Miller
Date: Sun Aug 18 2019 - 16:03:40 EST


From: Wenwen Wang <wenwen@xxxxxxxxxx>
Date: Wed, 14 Aug 2019 13:56:43 -0500

> In kalmia_init_and_get_ethernet_addr(), 'usb_buf' is allocated through
> kmalloc(). In the following execution, if the 'status' returned by
> kalmia_send_init_packet() is not 0, 'usb_buf' is not deallocated, leading
> to memory leaks. To fix this issue, add the 'out' label to free 'usb_buf'.
>
> Signed-off-by: Wenwen Wang <wenwen@xxxxxxxxxx>

Applied.