mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-29 14:05:19 +08:00
iw_cxgb4: check return value of alloc_skb
Function alloc_skb() will return a NULL pointer when there is no enough memory. However, the return value of alloc_skb() is directly used without validation in function send_fw_pass_open_req(). This patches checks the return value of alloc_skb() against NULL. Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
27b0b83233
commit
9ef63f31ad
@ -3799,6 +3799,8 @@ static void send_fw_pass_open_req(struct c4iw_dev *dev, struct sk_buff *skb,
|
||||
int ret;
|
||||
|
||||
req_skb = alloc_skb(sizeof(struct fw_ofld_connection_wr), GFP_KERNEL);
|
||||
if (!req_skb)
|
||||
return;
|
||||
req = (struct fw_ofld_connection_wr *)__skb_put(req_skb, sizeof(*req));
|
||||
memset(req, 0, sizeof(*req));
|
||||
req->op_compl = htonl(WR_OP_V(FW_OFLD_CONNECTION_WR) | FW_WR_COMPL_F);
|
||||
|
Loading…
Reference in New Issue
Block a user