]> git.baikalelectronics.ru Git - kernel.git/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)
committerJason Gunthorpe <jgg@mellanox.com>
Tue, 16 Apr 2019 11:03:17 +0000 (08:03 -0300)
commit259b623c0129d2b5391a2b953b14285fcef71978
tree5f9a9ea6515a97a7536b5b3eacba30c840dbdb98
parent46734bb8e477aeefbffa7b27971061fe7c13c5a0
RDMA/cxgb4: Fix null pointer dereference on alloc_skb failure

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: 6e7f7ee59233 ("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>
drivers/infiniband/hw/cxgb4/cm.c