DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Patil, Harish" <Harish.Patil@cavium.com>
To: Rongqiang XIE <xie.rongqiang@zte.com.cn>,
	"Mody, Rasesh" <Rasesh.Mody@cavium.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/qede:fix the bug about pointer params may NULL
Date: Fri, 25 Aug 2017 18:43:56 +0000	[thread overview]
Message-ID: <D5C5BCFE.15B4DF%Harish.Patil@cavium.com> (raw)
In-Reply-To: <1503558753-8545-1-git-send-email-xie.rongqiang@zte.com.cn>

-----Original Message-----
From: dev <dev-bounces@dpdk.org> on behalf of Rongqiang XIE
<xie.rongqiang@zte.com.cn>
Date: Thursday, August 24, 2017 at 12:12 AM
To: "Mody, Rasesh" <Rasesh.Mody@cavium.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>, Rongqiang XIE <xie.rongqiang@zte.com.cn>
Subject: [dpdk-dev] [PATCH] net/qede:fix the bug about pointer params
may	NULL

>In function qede_rss_reta_update(),the pointer params returned from
>call to function rte_zmalloc() may be NULL and will be dereferenced.
>So, should judge the params is NULL or not.
>
>Signed-off-by: Rongqiang XIE <xie.rongqiang@zte.com.cn>
>---
> drivers/net/qede/qede_ethdev.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
>diff --git a/drivers/net/qede/qede_ethdev.c
>b/drivers/net/qede/qede_ethdev.c
>index 0e05989..4e9e89f 100644
>--- a/drivers/net/qede/qede_ethdev.c
>+++ b/drivers/net/qede/qede_ethdev.c
>@@ -2012,6 +2012,10 @@ int qede_rss_reta_update(struct rte_eth_dev
>*eth_dev,
> 	memset(&vport_update_params, 0, sizeof(vport_update_params));
> 	params = rte_zmalloc("qede_rss", sizeof(*params) * edev->num_hwfns,
> 			     RTE_CACHE_LINE_SIZE);
>+	if (params == NULL) {
>+		DP_ERR(edev, "failed to allocate memory\n");
>+		return -ENOMEM;
>+	}
> 
> 	for (i = 0; i < reta_size; i++) {
> 		idx = i / RTE_RETA_GROUP_SIZE;
>-- 
>1.8.3.1
>
>
>Acked-by: Harish Patil <harish.patil@cavium.com>


  reply	other threads:[~2017-08-25 18:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-24  7:12 Rongqiang XIE
2017-08-25 18:43 ` Patil, Harish [this message]
2017-08-28 12:42   ` 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=D5C5BCFE.15B4DF%Harish.Patil@cavium.com \
    --to=harish.patil@cavium.com \
    --cc=Rasesh.Mody@cavium.com \
    --cc=dev@dpdk.org \
    --cc=xie.rongqiang@zte.com.cn \
    /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).