DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ring: fix return value check
@ 2019-04-23 15:31 Ferruh Yigit
  2019-04-23 15:31 ` Ferruh Yigit
  2019-04-23 15:49 ` Bruce Richardson
  0 siblings, 2 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-04-23 15:31 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

'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;
 }
-- 
2.20.1

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH] net/ring: fix return value check
  2019-04-23 15:31 [dpdk-dev] [PATCH] net/ring: fix return value check Ferruh Yigit
@ 2019-04-23 15:31 ` Ferruh Yigit
  2019-04-23 15:49 ` Bruce Richardson
  1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-04-23 15:31 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

'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;
 }
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ring: fix return value check
  2019-04-23 15:31 [dpdk-dev] [PATCH] net/ring: fix return value check 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
  1 sibling, 2 replies; 6+ messages in thread
From: Bruce Richardson @ 2019-04-23 15:49 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, stable

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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ring: fix return value check
  2019-04-23 15:49 ` Bruce Richardson
@ 2019-04-23 15:49   ` Bruce Richardson
  2019-04-24 16:49   ` Ferruh Yigit
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2019-04-23 15:49 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, stable

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>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ring: fix return value check
  2019-04-23 15:49 ` Bruce Richardson
  2019-04-23 15:49   ` Bruce Richardson
@ 2019-04-24 16:49   ` Ferruh Yigit
  2019-04-24 16:49     ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-04-24 16:49 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH] net/ring: fix return value check
  2019-04-24 16:49   ` Ferruh Yigit
@ 2019-04-24 16:49     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-04-24 16:49 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: dev, stable

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-04-24 16:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-23 15:31 [dpdk-dev] [PATCH] net/ring: fix return value check 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
2019-04-24 16:49     ` Ferruh Yigit

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).