]> git.baikalelectronics.ru Git - kernel.git/commit
staging: ks7010: move skb null check near allocation
authorTobin C. Harding <me@tobin.cc>
Thu, 27 Apr 2017 01:25:14 +0000 (11:25 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Apr 2017 09:45:49 +0000 (11:45 +0200)
commit9e2961b043f05dbe61ebd144188ace8bfff2d282
treeedee85a9f4ce568501fc800698f28e493038fdda
parent6b010c4cb2a9f87ffcde7cdc4d9c6457ea11b65a
staging: ks7010: move skb null check near allocation

Currently, after allocating an sk_buff, driver fills the sk_buff
within code block guarded by a NULL check on the sk_buff. If a NULL
check is done immediately after the allocation, and code returns on
error, then the subsequent code need not be guarded and the level of
indentation may be reduced. This aids the readability of the code and
makes explicit the error path.

Check for NULL directly after allocating the sk_buff, return if
allocation fails. Reduce indentation of subsequent code. Do not change
the program logic.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ks7010/ks_hostif.c