DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] net/cxgbe: fix a bug in t4_wr_mbox_meat_timeout
@ 2017-03-28  7:32 henry
  2017-03-30 11:28 ` Rahul Lakkireddy
  2017-03-30 16:08 ` Ferruh Yigit
  0 siblings, 2 replies; 5+ messages in thread
From: henry @ 2017-03-28  7:32 UTC (permalink / raw)
  To: rahul.lakkireddy; +Cc: dev, nirranjan, wangyunjian, zhoujingbin, henry

Check return value of malloc

Signed-off-by: henry <caihe@huawei.com>
---
 drivers/net/cxgbe/base/t4_hw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c
index c089b06..9dca8da 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;
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-04-07 10:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-28  7:32 [dpdk-dev] [PATCH v2] net/cxgbe: fix a bug in t4_wr_mbox_meat_timeout henry
2017-03-30 11:28 ` Rahul Lakkireddy
2017-04-07 10:50   ` Ferruh Yigit
2017-03-30 16:08 ` Ferruh Yigit
2017-04-05 11:23   ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).