diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-06-13 22:26:11 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2013-06-14 19:37:16 +0200 |
commit | 1105a13bb8ad29cf83d46989ee462d196038be87 (patch) | |
tree | 5168bfdfb3a726b41bde8534746f9f5bdc216313 /drivers/net/wireless/orinoco | |
parent | ath9k: Add custom parameters for CUS198 (diff) | |
download | linux-1105a13bb8ad29cf83d46989ee462d196038be87.tar.xz linux-1105a13bb8ad29cf83d46989ee462d196038be87.zip |
orinoco_usb: fix memory leak in ezusb_access_ltv() when device disconnected
If "device is disconnected" check occurs to be true in ezusb_access_ltv(),
it just return -ENODEV. But that means request_context is leaked since
there are no any references to it anymore.
The patch adds a call to ezusb_request_context_put() before return.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/orinoco')
-rw-r--r-- | drivers/net/wireless/orinoco/orinoco_usb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/orinoco/orinoco_usb.c b/drivers/net/wireless/orinoco/orinoco_usb.c index 1f9cb55c3360..bdfe637953f4 100644 --- a/drivers/net/wireless/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/orinoco/orinoco_usb.c @@ -881,7 +881,8 @@ static int ezusb_access_ltv(struct ezusb_priv *upriv, if (!upriv->udev) { dbg("Device disconnected"); - return -ENODEV; + retval = -ENODEV; + goto exit; } if (upriv->read_urb->status != -EINPROGRESS) |