ieee802154: ca8210: Add checks for kmalloc allocation failures
authorColin Ian King <colin.king@canonical.com>
Wed, 29 Mar 2017 17:05:40 +0000 (18:05 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 12 Apr 2017 20:02:39 +0000 (22:02 +0200)
commit941825e11424f00f9a76c944c16f677aadfe3515
tree7dfa01cd87065c4ee79b04c8176e8b3f008cfaa7
parentf1554b7b2c27cedee6c772dab954629987690110
ieee802154: ca8210: Add checks for kmalloc allocation failures

Ensure we don't end up with a null pointer dereferences by checking
for for allocation failures.  Allocate by sizeof(*ptr) rather than
the type to fix checkpack warnings.  Also merge multiple lines into
one line for the kmalloc call.

Detected by CoverityScan, CID#1422435 ("Dereference null return value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/net/ieee802154/ca8210.c