]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
lan78xx: Fix memory leaks
authorWenwen Wang <wenwen@cs.uga.edu>
Wed, 14 Aug 2019 16:23:13 +0000 (11:23 -0500)
committerKhalid Elmously <khalid.elmously@canonical.com>
Thu, 26 Sep 2019 04:34:52 +0000 (00:34 -0400)
commitd628a888efabd1772ad730ed3f18b1b30e7beed9
tree5881affd7470f6feadf153849968ac8e57c45ea9
parent948f0f19b1c586f63618029596cadd9cc05199e6
lan78xx: Fix memory leaks

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

In lan78xx_probe(), a new urb is allocated through usb_alloc_urb() and
saved to 'dev->urb_intr'. However, in the following execution, if an error
occurs, 'dev->urb_intr' is not deallocated, leading to memory leaks. To fix
this issue, invoke usb_free_urb() to free the allocated urb before
returning from the function.

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/lan78xx.c