staging: rtl8192u: Check some memory allocation failure
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 22 Sep 2017 19:35:53 +0000 (21:35 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Oct 2017 16:34:57 +0000 (18:34 +0200)
commit5fef87cbbf422e0f6792ac9c8536fd6aa795f1f4
treeb926c8c6b5ddf62cdf6ac0fa2df4d52b239c91bf
parent1ce72e8ac57a999c2864249567fc313a0def60c9
staging: rtl8192u: Check some memory allocation failure

If one of these memory allocations fail, a NULL pointer dereference will
occur later on.
Return -ENOMEM instead.

There is no need to free the resources already allocated, this is done
by the caller (i.e. 'rtl8192_usb_probe()') which calls
'rtl8192_usb_deleteendpoints()'.

The calling graph is:
rtl8192_usb_probe
  --> rtl8192_init
    --> rtl8192_usb_initendpoints

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192u/r8192U_core.c