]> git.karo-electronics.de Git - linux-beck.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)
commitd3d472b6e57e55132a0c2a048e3b18759c73ee7b
tree01b10867e2dc7d01629efb6a6d293bcc89150143
parentbf1ace2a3f0d133a662727f238928654bdc1d1b3
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