Skip to contentSkip to conversation

net/iavf: fix resource leak issue

PATCH Applied Wenjun Wu 3 participants 11 messages May 10, 2022 – May 18, 2022 Network drivers

lore
Share & tools
lore

Wenjun Wu

author
#0 lore raw

PATCH 1/1 net/iavf: fix resource leak issue

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")
---
 drivers/net/iavf/iavf_ethdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/iavf/iavf_ethdev.c +2 -1
index d1a2b53675..82672841f4 100644
@@ -2188,7 +2188,8 @@ static int iavf_parse_devargs(struct rte_eth_dev *dev)
 	if (ad->devargs.quanta_size < 256 || ad->devargs.quanta_size > 4096 ||
 	    ad->devargs.quanta_size & 0x40) {
 		PMD_INIT_LOG(ERR, "invalid quanta size\n");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto bail;
 	}
 
 bail:
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Tuesday, May 10, 2022 8:54 AM
To: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [PATCH v1] net/iavf: fix resource leak issue

Quoted 6 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")

Applied to dpdk-next-net-intel.

Thanks
Qi

#2 lore raw

11/05/2022 13:46, Zhang, Qi Z:

Quoted 4 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 3 lines

This patch fixes resource leak issue reported by coverity.

Quoted 8 lines
Quoted 4 lines

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

#3 lore raw
Quoted 18 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Wednesday, May 11, 2022 10:52 PM
To: Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

11/05/2022 13:46, Zhang, Qi Z:

Quoted 7 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 6 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")
Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

#4 lore raw

11/05/2022 17:31, Zhang, Qi Z:

Quoted 15 lines

From: Thomas Monjalon <[email protected]>

Quoted 14 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 12 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 7 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")

Applied to dpdk-next-net-intel.

Quoted 7 lines
Quoted 3 lines

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

It does not explain what is the scenario. What is the impacted feature?

#5 lore raw
Quoted 30 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 5:17 AM
To: Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

11/05/2022 17:31, Zhang, Qi Z:

Quoted 19 lines

From: Thomas Monjalon <[email protected]>

Quoted 17 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 4 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 3 lines

This patch fixes resource leak issue reported by coverity.

Quoted 8 lines
Quoted 4 lines

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Quoted 5 lines
Quoted 3 lines

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

It does not explain what is the scenario. What is the impacted feature?

I think the scenario has been explained as

"kvlist should be freed before return an error due to invalid quanta size"

the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

i agree "memory leak" would be better.

Quoted 1 line
#6 lore raw

12/05/2022 02:20, Zhang, Qi Z:

Quoted 31 lines
Quoted 31 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 5:17 AM
To: Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

11/05/2022 17:31, Zhang, Qi Z:

Quoted 21 lines

From: Thomas Monjalon <[email protected]>

Quoted 8 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 7 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 6 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size configuration")
Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

Quoted 8 lines
Quoted 3 lines
Quoted 1 line

kvlist should be freed before return an error due to invalid quanta size.

It does not explain what is the scenario. What is the impacted feature?

I think the scenario has been explained as

"kvlist should be freed before return an error due to invalid quanta size"
the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

No, it does not say how to reproduce (the scenario). We have no idea where it is in the code.

#7 lore raw
Quoted 48 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 3:07 PM
To: Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

12/05/2022 02:20, Zhang, Qi Z:

Quoted 37 lines
Quoted 36 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 5:17 AM
To: Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

11/05/2022 17:31, Zhang, Qi Z:

Quoted 16 lines

From: Thomas Monjalon <[email protected]>

Quoted 15 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 13 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 8 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size

configuration")

Applied to dpdk-next-net-intel.

Quoted 7 lines
Quoted 3 lines

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

It does not explain what is the scenario. What is the impacted feature?

Quoted 8 lines
Quoted 5 lines

I think the scenario has been explained as

"kvlist should be freed before return an error due to invalid quanta size" the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

No, it does not say how to reproduce (the scenario). We have no idea where it is in the code.

set an invalid quanta size from devargs will reproduce the issue

Quoted 2 lines
#8 lore raw
Quoted 60 lines

-----Original Message-----
From: Zhang, Qi Z <[email protected]>
Sent: Thursday, May 12, 2022 3:21 PM
To: Thomas Monjalon <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: RE: [PATCH v1] net/iavf: fix resource leak issue

Quoted 48 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 3:07 PM
To: Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

12/05/2022 02:20, Zhang, Qi Z:

Quoted 39 lines
Quoted 31 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Thursday, May 12, 2022 5:17 AM
To: Wu, Wenjun1 <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

11/05/2022 17:31, Zhang, Qi Z:

Quoted 20 lines

From: Thomas Monjalon <[email protected]>

Quoted 18 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 8 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 7 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size

configuration")

Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Quoted 5 lines
Quoted 3 lines

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

It does not explain what is the scenario. What is the impacted feature?

I think the scenario has been explained as

Quoted 10 lines
Quoted 6 lines
Quoted 3 lines

"kvlist should be freed before return an error due to invalid quanta size" the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

No, it does not say how to reproduce (the scenario). We have no idea where it is in the code.

set an invalid quanta size from devargs will reproduce the issue

Quoted 2 lines

Refine the Title / commit log in dpdk-next-net-intel as below to answer Thomas's questions

net/iavf: fix memory leak issue

Set an invalid quanta size from devargs will cause memory leak and this is reported by coverity.

The patch fix the issue by correcting the error handle.

#9 lore raw

17/05/2022 02:59, Zhang, Qi Z:

Quoted 40 lines

From: Zhang, Qi Z <[email protected]>

Quoted 39 lines

From: Thomas Monjalon <[email protected]>

Quoted 37 lines

12/05/2022 02:20, Zhang, Qi Z:

Quoted 26 lines

From: Thomas Monjalon <[email protected]>

Quoted 25 lines

11/05/2022 17:31, Zhang, Qi Z:

Quoted 23 lines

From: Thomas Monjalon <[email protected]>

Quoted 9 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 8 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 7 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size

configuration")

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta size.

Quoted 7 lines
Quoted 1 line

It does not explain what is the scenario. What is the impacted feature?

I think the scenario has been explained as

"kvlist should be freed before return an error due to invalid quanta size" the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

No, it does not say how to reproduce (the scenario). We have no idea where it is in the code.

Quoted 6 lines
Quoted 3 lines

set an invalid quanta size from devargs will reproduce the issue

Quoted 2 lines

Refine the Title / commit log in dpdk-next-net-intel as below to answer Thomas's questions

net/iavf: fix memory leak issue

A memory leak is an issue for sure, so no need to add "issue".

Quoted 1 line

Set an invalid quanta size from devargs will cause memory leak and this

Set -> Setting

Quoted 3 lines

is reported by coverity.

The patch fix the issue by correcting the error handle.

handle -> handling

Thanks

#10 lore raw
Quoted 67 lines

-----Original Message-----
From: Thomas Monjalon <[email protected]>
Sent: Tuesday, May 17, 2022 2:52 PM
To: Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>; [email protected]; Wu, Jingjing <[email protected]>; Xing, Beilei <[email protected]>
Subject: Re: [PATCH v1] net/iavf: fix resource leak issue

17/05/2022 02:59, Zhang, Qi Z:

Quoted 28 lines

From: Zhang, Qi Z <[email protected]>

Quoted 27 lines

From: Thomas Monjalon <[email protected]>

Quoted 26 lines

12/05/2022 02:20, Zhang, Qi Z:

Quoted 25 lines

From: Thomas Monjalon <[email protected]>

Quoted 24 lines

11/05/2022 17:31, Zhang, Qi Z:

Quoted 23 lines

From: Thomas Monjalon <[email protected]>

Quoted 9 lines

11/05/2022 13:46, Zhang, Qi Z:

Quoted 8 lines

From: Wu, Wenjun1 <[email protected]>

Quoted 7 lines

This patch fixes resource leak issue reported by coverity.

Coverity issue: 378017

Fixes b14e8a57b9fe ("net/iavf: support quanta size

configuration")

Quoted 9 lines
Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net-intel.

In the title, the word "issue" is useless.
It would be more interesting to precise where is the leak.

Added below into commit log in dpdk-next-net-intel.

kvlist should be freed before return an error due to invalid quanta

size.

Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Quoted 8 lines
Quoted 2 lines

It does not explain what is the scenario. What is the impacted feature?

I think the scenario has been explained as

"kvlist should be freed before return an error due to invalid quanta size" the impact has been mentioned as "resource leak" I guess this is how Coverity describe the issue

No, it does not say how to reproduce (the scenario). We have no idea where it is in the code.

Quoted 7 lines
Quoted 3 lines

set an invalid quanta size from devargs will reproduce the issue

Quoted 2 lines

Refine the Title / commit log in dpdk-next-net-intel as below to answer Thomas's questions

net/iavf: fix memory leak issue

A memory leak is an issue for sure, so no need to add "issue".

Quoted 2 lines

Set an invalid quanta size from devargs will cause memory leak and this

Set -> Setting

Quoted 8 lines
Quoted 3 lines

is reported by coverity.

The patch fix the issue by correcting the error handle.

handle -> handling

Thanks

Ok fixed grammar in dpdk-next-net-intel as suggested.