From: Henry Cai Date: Tue, 28 Mar 2017 07:32:20 +0000 (+0800) Subject: net/cxgbe: fix possible null pointer dereference X-Git-Tag: spdx-start~3631 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4a8f7cdd2281c7d904eae5b5ee92e4214e945e51;p=dpdk.git net/cxgbe: fix possible null pointer dereference Check return value of malloc. Fixes: 3bd122eef2cc ("cxgbe/base: add hardware API for Chelsio T5 series adapters") Cc: stable@dpdk.org Signed-off-by: Henry Cai Acked-by: Rahul Lakkireddy --- diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c index c089b068d2..9dca8da16d 100644 --- a/drivers/net/cxgbe/base/t4_hw.c +++ b/drivers/net/cxgbe/base/t4_hw.c @@ -359,6 +359,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, struct mbox_entry entry; u32 pcie_fw = 0; + if (!temp) + return -ENOMEM; + if ((size & 15) || size > MBOX_LEN) { free(temp); return -EINVAL;