diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2016-08-11 17:38:54 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2016-09-03 13:06:49 +0300 |
commit | 410280bac6224e066f4cf0b87db08f0418a135b6 (patch) | |
tree | 5f8723a8727ec8b3cfd147f9aab0e751958fa038 /drivers/net | |
parent | 72539799104d4d70c2afcb8f0fe2a7a507a41c81 (diff) | |
download | linux-410280bac6224e066f4cf0b87db08f0418a135b6.tar.xz |
rt2x00usb: Fix error return code
We know that 'retval = 0' because it has been tested a few lines above.
So, if 'devm_kmalloc' fails, 0 will be returned instead of an error code.
Return -ENOMEM instead.
Fixes: 8b4c0009313f ("rt2x00usb: Use usb anchor to manage URB")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ralink/rt2x00/rt2x00usb.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c index 7cf26c6124d1..6005e14213ca 100644 --- a/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2x00usb.c @@ -831,8 +831,10 @@ int rt2x00usb_probe(struct usb_interface *usb_intf, rt2x00dev->anchor = devm_kmalloc(&usb_dev->dev, sizeof(struct usb_anchor), GFP_KERNEL); - if (!rt2x00dev->anchor) + if (!rt2x00dev->anchor) { + retval = -ENOMEM; goto exit_free_reg; + } init_usb_anchor(rt2x00dev->anchor); return 0; |