• Xiyu Yang's avatar
    wimax/i2400m: Fix potential urb refcnt leak · 7717cbec
    Xiyu Yang authored
    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: default avatarXiyu Yang <xiyuyang19@fudan.edu.cn>
    Signed-off-by: default avatarXin Tan <tanxin.ctf@gmail.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    7717cbec
usb-fw.c 10.9 KB