DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v2] net/mana: fix uninitialized scalar variable
@ 2024-06-10 22:07 mmaatuq
  2024-06-12 13:17 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: mmaatuq @ 2024-06-10 22:07 UTC (permalink / raw)
  To: Long Li; +Cc: dev, mmaatuq

in case we didn't enter or finished the loop without getting ifname we
ret shouldn't have an arbitrary value.

Coverity issue: 424690

Signed-off-by: mmaatuq <mahmoudmatook.mm@gmail.com>
---
v2:
 Fixed typo in word "arbitrary"
---
 drivers/net/mana/mana.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
index 68c625258e..c37c4e3444 100644
--- a/drivers/net/mana/mana.c
+++ b/drivers/net/mana/mana.c
@@ -715,7 +715,7 @@ mana_dev_stats_reset(struct rte_eth_dev *dev __rte_unused)
 static int
 mana_get_ifname(const struct mana_priv *priv, char (*ifname)[IF_NAMESIZE])
 {
-	int ret;
+	int ret = -ENODEV;
 	DIR *dir;
 	struct dirent *dent;

--
2.43.0


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

* Re: [PATCH v2] net/mana: fix uninitialized scalar variable
  2024-06-10 22:07 [PATCH v2] net/mana: fix uninitialized scalar variable mmaatuq
@ 2024-06-12 13:17 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2024-06-12 13:17 UTC (permalink / raw)
  To: mmaatuq, Long Li; +Cc: dev

On 6/10/2024 11:07 PM, mmaatuq wrote:
> in case we didn't enter or finished the loop without getting ifname we
> ret shouldn't have an arbitrary value.
> 
> Coverity issue: 424690
> 
> Signed-off-by: mmaatuq <mahmoudmatook.mm@gmail.com>
>

Change looks good to me,
but can you please add Fixes tag [1] and perhaps stable tag based on the
fixes tag, checkpatch will generate a warning for it if required, after
Fixes tag added.

Also can you please use full name, as following capitalization:
Name Surname <email-all-lowercase@domain.com>


[1]
https://doc.dpdk.org/guides/contributing/patches.html#commit-messages-body


> ---
> v2:
>  Fixed typo in word "arbitrary"
> ---
>  drivers/net/mana/mana.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c
> index 68c625258e..c37c4e3444 100644
> --- a/drivers/net/mana/mana.c
> +++ b/drivers/net/mana/mana.c
> @@ -715,7 +715,7 @@ mana_dev_stats_reset(struct rte_eth_dev *dev __rte_unused)
>  static int
>  mana_get_ifname(const struct mana_priv *priv, char (*ifname)[IF_NAMESIZE])
>  {
> -	int ret;
> +	int ret = -ENODEV;
>  	DIR *dir;
>  	struct dirent *dent;
> 
> --
> 2.43.0
> 


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

end of thread, other threads:[~2024-06-12 13:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-10 22:07 [PATCH v2] net/mana: fix uninitialized scalar variable mmaatuq
2024-06-12 13:17 ` 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).