Commit d3d472b6 authored by Harsh Kumar's avatar Harsh Kumar Committed by Greg Kroah-Hartman

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: default avatarHarsh Kumar <harsh1kumar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bf1ace2a
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment