DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rongqiang XIE <xie.rongqiang@zte.com.cn>
To: johndale@cisco.com
Cc: dev@dpdk.org, Rongqiang XIE <xie.rongqiang@zte.com.cn>
Subject: [dpdk-dev] [PATCH] net/enic:fix no return value bug
Date: Wed, 23 Aug 2017 16:49:24 +0800	[thread overview]
Message-ID: <1503478164-13185-1-git-send-email-xie.rongqiang@zte.com.cn> (raw)

In enic_alloc_consistent() function, if the value mze malloc
faile, !mze is true, free the rz should return NULL.

Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
---
 drivers/net/enic/enic_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 40dbec7..1d956cd 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -368,6 +368,7 @@ void enic_init_vnic_resources(struct enic *enic)
 		pr_err("%s : Failed to allocate memory for memzone list\n",
 		       __func__);
 		rte_memzone_free(rz);
+		return NULL;
 	}
 
 	mze->rz = rz;
-- 
1.8.3.1

             reply	other threads:[~2017-08-23  8:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-23  8:49 Rongqiang XIE [this message]
2017-08-28 11:31 ` Ferruh Yigit
2017-08-28 11:36   ` 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=1503478164-13185-1-git-send-email-xie.rongqiang@zte.com.cn \
    --to=xie.rongqiang@zte.com.cn \
    --cc=dev@dpdk.org \
    --cc=johndale@cisco.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).