All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ice: remove redundant null check on pf
@ 2021-01-27 11:50 ` wangyunjian
  0 siblings, 0 replies; 4+ messages in thread
From: wangyunjian @ 2021-01-27 11:50 UTC (permalink / raw)
  To: kuba, davem
  Cc: intel-wired-lan, netdev, jerry.lilijun, xudingke, Yunjian Wang

From: Yunjian Wang <wangyunjian@huawei.com>

Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced.
So the additional check is unnecessary, just remove it.

Addresses-Coverity: ("Dereference before null check")
Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 6e251dfffc91..43117cb4ef18 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -788,11 +788,6 @@ static void ice_set_dflt_mib(struct ice_pf *pf)
 	struct ice_hw *hw;
 	u32 ouisubtype;
 
-	if (!pf) {
-		dev_dbg(dev, "%s NULL pf pointer\n", __func__);
-		return;
-	}
-
 	hw = &pf->hw;
 	mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB;
 	lldpmib = kzalloc(ICE_LLDPDU_SIZE, GFP_KERNEL);
-- 
2.23.0


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

* [Intel-wired-lan] [PATCH net-next] ice: remove redundant null check on pf
@ 2021-01-27 11:50 ` wangyunjian
  0 siblings, 0 replies; 4+ messages in thread
From: wangyunjian @ 2021-01-27 11:50 UTC (permalink / raw)
  To: intel-wired-lan

From: Yunjian Wang <wangyunjian@huawei.com>

Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced.
So the additional check is unnecessary, just remove it.

Addresses-Coverity: ("Dereference before null check")
Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround")
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
 drivers/net/ethernet/intel/ice/ice_main.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c
index 6e251dfffc91..43117cb4ef18 100644
--- a/drivers/net/ethernet/intel/ice/ice_main.c
+++ b/drivers/net/ethernet/intel/ice/ice_main.c
@@ -788,11 +788,6 @@ static void ice_set_dflt_mib(struct ice_pf *pf)
 	struct ice_hw *hw;
 	u32 ouisubtype;
 
-	if (!pf) {
-		dev_dbg(dev, "%s NULL pf pointer\n", __func__);
-		return;
-	}
-
 	hw = &pf->hw;
 	mib_type = SET_LOCAL_MIB_TYPE_LOCAL_MIB;
 	lldpmib = kzalloc(ICE_LLDPDU_SIZE, GFP_KERNEL);
-- 
2.23.0


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

* Re: [Intel-wired-lan] [PATCH net-next] ice: remove redundant null check on pf
  2021-01-27 11:50 ` [Intel-wired-lan] " wangyunjian
@ 2021-01-27 23:37   ` Nguyen, Anthony L
  -1 siblings, 0 replies; 4+ messages in thread
From: Nguyen, Anthony L @ 2021-01-27 23:37 UTC (permalink / raw)
  To: kuba, davem, wangyunjian; +Cc: netdev, jerry.lilijun, intel-wired-lan, xudingke

On Wed, 2021-01-27 at 19:50 +0800, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced.
> So the additional check is unnecessary, just remove it.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround")
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---

Thanks for the patch Yunjian. However, we do have a patch coming[1]
that fixes this issue.

Thanks,
Tony

[1] https://patchwork.ozlabs.org/project/intel-wired-
lan/patch/20201012225326.15722-1-anthony.l.nguyen@intel.com/

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

* [Intel-wired-lan] [PATCH net-next] ice: remove redundant null check on pf
@ 2021-01-27 23:37   ` Nguyen, Anthony L
  0 siblings, 0 replies; 4+ messages in thread
From: Nguyen, Anthony L @ 2021-01-27 23:37 UTC (permalink / raw)
  To: intel-wired-lan

On Wed, 2021-01-27 at 19:50 +0800, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
> 
> Before calling ice_set_dflt_mib(), the 'pf' has been dereferenced.
> So the additional check is unnecessary, just remove it.
> 
> Addresses-Coverity: ("Dereference before null check")
> Fixes: 7d9c9b791f9e ("ice: Implement LFC workaround")
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---

Thanks for the patch Yunjian. However, we do have a patch coming[1]
that fixes this issue.

Thanks,
Tony

[1] https://patchwork.ozlabs.org/project/intel-wired-
lan/patch/20201012225326.15722-1-anthony.l.nguyen at intel.com/

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

end of thread, other threads:[~2021-01-27 23:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-27 11:50 [PATCH net-next] ice: remove redundant null check on pf wangyunjian
2021-01-27 11:50 ` [Intel-wired-lan] " wangyunjian
2021-01-27 23:37 ` Nguyen, Anthony L
2021-01-27 23:37   ` Nguyen, Anthony L

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.