]> git.baikalelectronics.ru Git - kernel.git/commit
net/ncsi: check for null return from call to nla_nest_start
authorColin Ian King <colin.king@canonical.com>
Mon, 26 Mar 2018 11:27:12 +0000 (12:27 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Mar 2018 14:38:26 +0000 (10:38 -0400)
commit0df81a3e6136cb59a359d7dfb4c8ab40623cbe9d
treed3f650d83596587b191d5d14bca64b26c58414a5
parent86226fa306d3875189215eb3362a08e8385bc7fa
net/ncsi: check for null return from call to nla_nest_start

The call to nla_nest_start calls nla_put which can lead to a NULL
return so it's possible for attr to become NULL and we can potentially
get a NULL pointer dereference on attr.  Fix this by checking for
a NULL return.

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

Fixes: f4592e0f15b0 ("net/ncsi: Add generic netlink family")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ncsi/ncsi-netlink.c