rt2x00usb: Fix error return code
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>
Thu, 11 Aug 2016 14:38:54 +0000 (16:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 31 Oct 2016 11:02:08 +0000 (05:02 -0600)
commit5a1bef589179d64202f10a296736a41ca0e98637
tree7abe482cc6e9d46556f13916f316b70807ee659a
parentea288a690cc4e53a528ae6a1d37cd6e14320ed27
rt2x00usb: Fix error return code

commit 410280bac6224e066f4cf0b87db08f0418a135b6 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/wireless/ralink/rt2x00/rt2x00usb.c