[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230904115925.261974-1-artem.chernyshev@red-soft.ru>
Date: Mon, 4 Sep 2023 14:59:25 +0300
From: Artem Chernyshev <artem.chernyshev@...-soft.ru>
To: Leon Romanovsky <leon@...nel.org>
Cc: Artem Chernyshev <artem.chernyshev@...-soft.ru>,
Potnuri Bharat Teja <bharat@...lsio.com>,
Jason Gunthorpe <jgg@...pe.ca>, linux-rdma@...r.kernel.org,
linux-kernel@...r.kernel.org, lvc-project@...uxtesting.org
Subject: [PATCH] infiniband: cxgb4: cm: Check skb value
get_skb() can't allocate skb in case of OOM.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Artem Chernyshev <artem.chernyshev@...-soft.ru>
---
drivers/infiniband/hw/cxgb4/cm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index ced615b5ea09..775da62b38ec 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -1965,6 +1965,10 @@ 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) {
+ pr_err("%s - cannot alloc skb!\n", __func__);
+ 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)));
--
2.37.3
z
Powered by blists - more mailing lists