DPDK patches and discussions
 help / color / mirror / Atom feed
From: henry <caihe@huawei.com>
To: <rahul.lakkireddy@chelsio.com>
Cc: <dev@dpdk.org>, <nirranjan@chelsio.com>, <wangyunjian@huawei.com>,
	<zhoujingbin@huawei.com>, henry <caihe@huawei.com>
Subject: [dpdk-dev] [PATCH v2] net/cxgbe: fix a bug in t4_wr_mbox_meat_timeout
Date: Tue, 28 Mar 2017 15:32:20 +0800	[thread overview]
Message-ID: <1490686340-9340-1-git-send-email-caihe@huawei.com> (raw)

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

             reply	other threads:[~2017-03-28  7:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28  7:32 henry [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1490686340-9340-1-git-send-email-caihe@huawei.com \
    --to=caihe@huawei.com \
    --cc=dev@dpdk.org \
    --cc=nirranjan@chelsio.com \
    --cc=rahul.lakkireddy@chelsio.com \
    --cc=wangyunjian@huawei.com \
    --cc=zhoujingbin@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).