]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
net: kalmia: fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Wed, 14 Aug 2019 18:56:43 +0000 (13:56 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commitec7646fe20d6e63bd9ac270b556a82c2a697c816
treea664422c48763744b0c868fd2d74f6cc0e459359
parenteffa07860a35788d8a18c61ec8982c2f4218918a
net: kalmia: fix memory leaks

BugLink: https://bugs.launchpad.net/bugs/1843463
[ Upstream commit f1472cb09f11ddb41d4be84f0650835cb65a9073 ]

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@cs.uga.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/net/usb/kalmia.c