DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] net/ring: fix return value check
Date: Wed, 24 Apr 2019 17:49:29 +0100	[thread overview]
Message-ID: <45eeb08e-27f7-ba5a-ab95-7ab4f2e4f402@intel.com> (raw)
Message-ID: <20190424164929.aKgH8uJIgr6jitdh782PDiB5CTl_9KUKIjiBx7oC1Xg@z> (raw)
In-Reply-To: <20190423154959.GA1864@bricha3-MOBL.ger.corp.intel.com>

On 4/23/2019 4:49 PM, Bruce Richardson wrote:
> On Tue, Apr 23, 2019 at 04:31:00PM +0100, Ferruh Yigit wrote:
>> 'rte_eth_dev_get_port_by_name()' return value is not checked caught by
>> coverity, adding return value check.
>>
>> Coverity issue: 305853
>> Fixes: 96cb19521147 ("net/ring: use EAL APIs in PMD specific API")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
>> ---
>>  drivers/net/ring/rte_eth_ring.c | 6 +++++-
>>  1 file changed, 5 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
>> index 115a882b5..5ec646594 100644
>> --- a/drivers/net/ring/rte_eth_ring.c
>> +++ b/drivers/net/ring/rte_eth_ring.c
>> @@ -385,7 +385,11 @@ rte_eth_from_rings(const char *name, struct rte_ring *const rx_queues[],
>>  		return -1;
>>  	}
>>  
>> -	rte_eth_dev_get_port_by_name(ring_name, &port_id);
>> +	ret = rte_eth_dev_get_port_by_name(ring_name, &port_id);
>> +	if (ret) {
>> +		rte_errno = ENODEV;
>> +		return -1;
>> +	}
>>  
>>  	return port_id;
>>  }
> 
> Looks reasonable to me.
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> 

Applied to dpdk-next-net/master, thanks.

  parent reply	other threads:[~2019-04-24 16:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-23 15:31 Ferruh Yigit
2019-04-23 15:31 ` Ferruh Yigit
2019-04-23 15:49 ` Bruce Richardson
2019-04-23 15:49   ` Bruce Richardson
2019-04-24 16:49   ` Ferruh Yigit [this message]
2019-04-24 16:49     ` 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=45eeb08e-27f7-ba5a-ab95-7ab4f2e4f402@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /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).