]> git.hungrycats.org Git - linux/commit
RDMA/cxgb4: Fix null pointer dereference on alloc_skb failure
authorColin Ian King <colin.king@canonical.com>
Sat, 13 Apr 2019 16:00:26 +0000 (17:00 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Mon, 23 Sep 2019 20:11:43 +0000 (21:11 +0100)
commite2cb920d34789a825299725a643fe31aebcea359
tree28f5a2c5a0f7cda38be7e3509e5130202bea86ac
parente4ce563ab1ba40caada77ce88b723102d82c23b9
RDMA/cxgb4: Fix null pointer dereference on alloc_skb failure

commit a6d2a5a92e67d151c98886babdc86d530d27111c upstream.

Currently if alloc_skb fails to allocate the skb a null skb is passed to
t4_set_arp_err_handler and this ends up dereferencing the null skb.  Avoid
the NULL pointer dereference by checking for a NULL skb and returning
early.

Addresses-Coverity: ("Dereference null return")
Fixes: b38a0ad8ec11 ("RDMA/cxgb4: Set arp error handler for PASS_ACCEPT_RPL messages")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Potnuri Bharat Teja <bharat@chelsio.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/infiniband/hw/cxgb4/cm.c