]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wimax/i2400m: Fix potential urb refcnt leak
authorXiyu Yang <xiyuyang19@fudan.edu.cn>
Wed, 15 Apr 2020 08:41:20 +0000 (16:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2020 08:28:01 +0000 (10:28 +0200)
commit5e76d93ec909095db2c30710fdaa57cd1f425884
tree9b155373233a4679b7554651d8bb3fb1ab9239b6
parentde37cb96b7dedf313733bc0a1f19e7f3b66dddd6
wimax/i2400m: Fix potential urb refcnt leak

[ Upstream commit 7717cbec172c3554d470023b4020d5781961187e ]

i2400mu_bus_bm_wait_for_ack() invokes usb_get_urb(), which increases the
refcount of the "notif_urb".

When i2400mu_bus_bm_wait_for_ack() returns, local variable "notif_urb"
becomes invalid, so the refcount should be decreased to keep refcount
balanced.

The issue happens in all paths of i2400mu_bus_bm_wait_for_ack(), which
forget to decrease the refcnt increased by usb_get_urb(), causing a
refcnt leak.

Fix this issue by calling usb_put_urb() before the
i2400mu_bus_bm_wait_for_ack() returns.

Signed-off-by: Xiyu Yang <xiyuyang19@fudan.edu.cn>
Signed-off-by: Xin Tan <tanxin.ctf@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wimax/i2400m/usb-fw.c