Skip to contentSkip to conversation

raw/ifpga/base: dereference before null check

PATCH Applied Tianfei zhang 6 participants 8 messages Sep 17, 2019 – Oct 28, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 raw/ifpga/base: dereference before null check

Add pointer null check before dereference.

Coverity issue: 344976

Fixes 12f92a51 ("raw/ifpga/base: fix retimer link status")
---
 drivers/raw/ifpga/base/opae_eth_group.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/raw/ifpga/base/opae_eth_group.c +1 -2
index d189dd578..be28954e0 100644
@@ -308,9 +308,8 @@ struct eth_group_device *eth_group_probe(void *base)
 
 void eth_group_release(struct eth_group_device *dev)
 {
-	eth_group_hw_uinit(dev);
-
 	if (dev) {
+		eth_group_hw_uinit(dev);
 		dev->status = ETH_GROUP_DEV_NOUSED;
 		opae_free(dev);
 	}
Signature · 1 line
2.17.1
#2 lore raw

Hi,

Quoted 14 lines

-----Original Message-----
From: David Marchand [mailto:[email protected]]
Sent: Friday, October 25, 2019 3:22
To: Xu, Rosen <[email protected]>; Zhang, Tianfei <[email protected]>
Cc: dev <[email protected]>; dpdk stable <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] raw/ifpga/base: dereference before null check

Quoted 3 lines · Tianfei zhang

Add pointer null check before dereference.

Quoted 7 lines
Quoted 5 lines

Coverity issue: 344976

Fixes 12f92a51 ("raw/ifpga/base: fix retimer link status")

This patch touches a "base driver" file, is this ok ?

It's just raw/ifpga internal base driver.

Quoted 3 lines

--
David Marchand

Reviewed-by on v1 1/1 Applied
#3 lore raw
In reply to Tianfei zhang
Quoted 29 lines · Tianfei zhang

Add pointer null check before dereference.

Coverity issue: 344976

Fixes 12f92a51 ("raw/ifpga/base: fix retimer link status")

---
drivers/raw/ifpga/base/opae_eth_group.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
drivers/raw/ifpga/base/opae_eth_group.c +1 -2
index d189dd578..be28954e0 100644
@@ -308,9 +308,8 @@ struct eth_group_device *eth_group_probe(void *base)
 
 void eth_group_release(struct eth_group_device *dev)
 {
-	eth_group_hw_uinit(dev);
-
 	if (dev) {
+		eth_group_hw_uinit(dev);
 		dev->status = ETH_GROUP_DEV_NOUSED;
 		opae_free(dev);
 	}
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel. Thanks.

#4 lore raw
Quoted 33 lines · Ye Xiaolong
Quoted 29 lines · Tianfei zhang

Add pointer null check before dereference.

Coverity issue: 344976

Fixes 12f92a51 ("raw/ifpga/base: fix retimer link status")

---
drivers/raw/ifpga/base/opae_eth_group.c | 3 +--

1 file changed, 1 insertion(+), 2 deletions(-)
drivers/raw/ifpga/base/opae_eth_group.c +1 -2
index d189dd578..be28954e0 100644
@@ -308,9 +308,8 @@ struct eth_group_device *eth_group_probe(void *base)
 
 void eth_group_release(struct eth_group_device *dev)
 {
-	eth_group_hw_uinit(dev);
-
 	if (dev) {
+		eth_group_hw_uinit(dev);
 		dev->status = ETH_GROUP_DEV_NOUSED;
 		opae_free(dev);
 	}
Signature · 1 line
2.17.1
Quoted 2 lines

Applied to dpdk-next-net-intel. Thanks.

Should we update the MAINTAINERS file to say that "drivers/raw/ifpga" merges to the next-net-intel?

#5 lore raw
Quoted 7 lines · Ferruh Yigit
Quoted 4 lines

Applied to dpdk-next-net-intel. Thanks.

Should we update the MAINTAINERS file to say that "drivers/raw/ifpga" merges to the next-net-intel?

Thanks, this area is, a bit, gray to me.
So a clarification is welcome.

--
David Marchand

#6 lore raw

25/10/2019 13:47, David Marchand:

Quoted 11 lines · Ferruh Yigit
Quoted 7 lines
Quoted 4 lines

Applied to dpdk-next-net-intel. Thanks.

Should we update the MAINTAINERS file to say that "drivers/raw/ifpga" merges to the next-net-intel?

Thanks, this area is, a bit, gray to me.
So a clarification is welcome.

Yes I think it is OK to get raw/ifpga in next-net-intel.

#7 lore raw
Quoted 7 lines · Thomas Monjalon

25/10/2019 13:47, David Marchand:

Quoted 6 lines · Ferruh Yigit
Quoted 5 lines
Quoted 4 lines

Applied to dpdk-next-net-intel. Thanks.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

Should we update the MAINTAINERS file to say that "drivers/raw/ifpga" merges to the next-net-intel?

Thanks, this area is, a bit, gray to me.
So a clarification is welcome.

Yes I think it is OK to get raw/ifpga in next-net-intel.

Done, just send a patch for it.

Thanks,
Xiaolong