DPDK patches and discussions
 help / color / mirror / Atom feed
From: Mohammad Abdul Awal <mohammad.abdul.awal@intel.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	"thomas@monjalon.net" <thomas@monjalon.net>
Cc: "rkerur@gmail.com" <rkerur@gmail.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] ether: fix invalid string length in ethdev name comparison
Date: Tue, 27 Feb 2018 08:51:54 +0000	[thread overview]
Message-ID: <8936b7cd-5141-addf-d3fd-1e4e1a95598b@intel.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725890578299@irsmsx105.ger.corp.intel.com>



On 27/02/2018 00:15, Ananyev, Konstantin wrote:
>
>> -----Original Message-----
>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Mohammad Abdul Awal
>>
>> +	len1 = strlen(name);
>>   	for (pid = 0; pid < RTE_MAX_ETHPORTS; pid++) {
>> +		len2 = strlen(rte_eth_dev_shared_data->data[pid].name);
>> +		len = len1 > len2 ? len1 : len2;
>>   		if (rte_eth_devices[pid].state != RTE_ETH_DEV_UNUSED &&
>>   		    !strncmp(name, rte_eth_dev_shared_data->data[pid].name,
>> -			     strlen(name))) {
>> +			     len)) {
> Why just not simply use strcmp()? :)
That is the best I would say. I will submit a V2.

>
>>   			*port_id = pid;
>>   			return 0;
>>   		}
>> --
>> 2.7.4

      reply	other threads:[~2018-02-27  8:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-26 23:21 Mohammad Abdul Awal
2018-02-27  0:15 ` Ananyev, Konstantin
2018-02-27  8:51   ` Mohammad Abdul Awal [this message]

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=8936b7cd-5141-addf-d3fd-1e4e1a95598b@intel.com \
    --to=mohammad.abdul.awal@intel.com \
    --cc=dev@dpdk.org \
    --cc=konstantin.ananyev@intel.com \
    --cc=rkerur@gmail.com \
    --cc=thomas@monjalon.net \
    /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).