]> git.baikalelectronics.ru Git - kernel.git/commit
Staging: winbond: Check for unsuccessful allocation immediately
authorHarsh Kumar <harsh1kumar@gmail.com>
Fri, 31 May 2013 15:30:42 +0000 (21:00 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jun 2013 19:32:00 +0000 (12:32 -0700)
commitebc48487fbc8dff37452bed793f2a220b47bf3f6
tree01b10867e2dc7d01629efb6a6d293bcc89150143
parent3844275125f636d933433e74d64066965e820421
Staging: winbond: Check for unsuccessful allocation immediately

Check to see if allocation by kzalloc() or usb_alloc_urb() was unsuccessful
immediately after the allocation. Exit from the function can be right at that
point in case of allocation failure.
This avoids unnecessary use of usb_alloc_urb() & usb_free_urb() if kzalloc()
returns NULL.
Also, makes the code better structured & easier to understand.

Signed-off-by: Harsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/winbond/wb35reg.c