]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 Apr 2020 22:00:22 +0000 (15:00 -0700)
commit67c8c2e65e9d688743915ef60283974135dc3868
tree966e93e86a520ad62fd4a92fed4143f28ede70b6
parentcdaea38960fd36eec8a06f139c40f9f2f9e2d2a7
wimax/i2400m: Fix potential urb refcnt leak

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>
drivers/net/wimax/i2400m/usb-fw.c