Re: [PATCH v4] staging: rtl8192u: add error handling for usb_alloc_urb

2018-06-16 Thread Dan Carpenter
I was actually OK with v1 on the theory that everything else leaked and so this didn't really introduce anything new... :P On Sat, Jun 16, 2018 at 10:01:22AM +0800, Zhouyang Jia wrote: > --- a/drivers/staging/rtl8192u/r8192U_core.c > +++ b/drivers/staging/rtl8192u/r8192U_core.c > @@ -1639,8

[PATCH v4] staging: rtl8192u: add error handling for usb_alloc_urb

2018-06-15 Thread Zhouyang Jia
When usb_alloc_urb fails, the lack of error-handling code may cause unexpected results. This patch adds error-handling code after calling usb_alloc_urb. Signed-off-by: Zhouyang Jia --- v1->v2: - Fix memory leak. v2->v3: - Release memory in error path. v3->v4: - Use kcalloc instead of