Commit 410280ba authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Kalle Valo

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: 8b4c0009 ("rt2x00usb: Use usb anchor to manage URB")
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarStanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent 72539799
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment