DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: caihe <caihe@huawei.com>,
	"helin.zhang@intel.com" <helin.zhang@intel.com>
Cc: "jingjing.wu@intel.com" <jingjing.wu@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	wangyunjian <wangyunjian@huawei.com>,
	"Lilijun (Jerry)" <jerry.lilijun@huawei.com>,
	Zhoujingbin <zhoujingbin@huawei.com>
Subject: Re: [dpdk-dev] [PATCH 1/1] net/i40e: check return value of rte_zmalloc
Date: Mon, 27 Mar 2017 12:00:17 +0100	[thread overview]
Message-ID: <84245870-8c4d-5631-3c8c-c87ae976b4c5@intel.com> (raw)
In-Reply-To: <453363AE6316CC428D594009B784F9050335F139@SZXEMI508-MBS.china.huawei.com>

On 3/25/2017 12:30 PM, caihe wrote:
> Hi helin,
> 
> There is a bug without check the return value of alloc memory in function i40evf_add_del_all_mac_addr,
> if we should fix it as below:

Hi Caihe,

Thank you for the patches.

There are a few details to pay attention while sending patches, can you
please check the contribution guide:
http://dpdk.org/doc/guides/contributing/patches.html

Most important piece, patch requires a signed-off-by tag:
http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body


There is a DPDK IRC channel (#dpdk) on freenode irc servers, please feel
free to ask there if you have any questions.

Thanks,
ferruh

> 
> diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
> index 55fd344..37ea7ac 100644
> --- a/drivers/net/i40e/i40e_ethdev_vf.c
> +++ b/drivers/net/i40e/i40e_ethdev_vf.c
> @@ -2014,6 +2014,11 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev,
>                 }
>  
>                 list = rte_zmalloc("i40evf_del_mac_buffer", len, 0);
> +               if (!list) {
> +                       PMD_DRV_LOG(ERR, "fail to alloc memory, abort execute command %s",
> +                               add ? "OP_ADD_ETHER_ADDRESS" : "OP_DEL_ETHER_ADDRESS");
> +                       return;
> +               }
>  
>                 for (i = begin; i < next_begin; i++) {
>                         addr = &dev->data->mac_addrs[i];
> 
> Best Regards
> 

  reply	other threads:[~2017-03-27 11:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-25 12:30 caihe
2017-03-27 11:00 ` Ferruh Yigit [this message]
2017-03-28  1:29 ` Zhang, Helin

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=84245870-8c4d-5631-3c8c-c87ae976b4c5@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=caihe@huawei.com \
    --cc=dev@dpdk.org \
    --cc=helin.zhang@intel.com \
    --cc=jerry.lilijun@huawei.com \
    --cc=jingjing.wu@intel.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).