summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorArtem Chernyshev <artem.chernyshev@red-soft.ru>2023-09-05 15:40:48 +0300
committerLeon Romanovsky <leon@kernel.org>2023-09-11 14:55:53 +0300
commit8fb8a82086f5bda6893ea6557c5a458e4549c6d7 (patch)
tree9d666f47188e414aecd67290a7febfe74f11bdfb /drivers
parent53a3f777049771496f791504e7dc8ef017cba590 (diff)
downloadlinux-stable-8fb8a82086f5bda6893ea6557c5a458e4549c6d7.tar.gz
linux-stable-8fb8a82086f5bda6893ea6557c5a458e4549c6d7.tar.bz2
linux-stable-8fb8a82086f5bda6893ea6557c5a458e4549c6d7.zip
RDMA/cxgb4: Check skb value for failure to allocate
get_skb() can fail to allocate skb, so check it. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 5be78ee924ae ("RDMA/cxgb4: Fix LE hash collision bug for active open connection") Signed-off-by: Artem Chernyshev <artem.chernyshev@red-soft.ru> Link: https://lore.kernel.org/r/20230905124048.284165-1-artem.chernyshev@red-soft.ru Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/cxgb4/cm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index ced615b5ea09..040ba2224f9f 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1965,6 +1965,9 @@ static int send_fw_act_open_req(struct c4iw_ep *ep, unsigned int atid)
int win;
skb = get_skb(NULL, sizeof(*req), GFP_KERNEL);
+ if (!skb)
+ return -ENOMEM;
+
req = __skb_put_zero(skb, sizeof(*req));
req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR));
req->len16_pkd = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(sizeof(*req), 16)));