intel-wired-lan.lists.osuosl.org archive mirror
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH net-next] ice: Remove unnecessary NULL check before dev_put
@ 2022-06-16  4:52 Ziyang Xuan
  2022-06-29 12:44 ` G, GurucharanX
  0 siblings, 1 reply; 2+ messages in thread
From: Ziyang Xuan @ 2022-06-16  4:52 UTC (permalink / raw)
  To: jesse.brandeburg, anthony.l.nguyen, davem, edumazet, kuba,
	pabeni, intel-wired-lan, netdev

Since commit b37a46683739 ("netdevice: add the case if dev is NULL"),
dev_put(NULL) is safe, check NULL before dev_put() is not needed.

Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
---
 drivers/net/ethernet/intel/ice/ice_lag.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_lag.c b/drivers/net/ethernet/intel/ice/ice_lag.c
index 4f954db01b92..c9f7393b783d 100644
--- a/drivers/net/ethernet/intel/ice/ice_lag.c
+++ b/drivers/net/ethernet/intel/ice/ice_lag.c
@@ -447,11 +447,9 @@ void ice_deinit_lag(struct ice_pf *pf)
 	if (lag->pf)
 		ice_unregister_lag_handler(lag);
 
-	if (lag->upper_netdev)
-		dev_put(lag->upper_netdev);
+	dev_put(lag->upper_netdev);
 
-	if (lag->peer_netdev)
-		dev_put(lag->peer_netdev);
+	dev_put(lag->peer_netdev);
 
 	kfree(lag);
 
-- 
2.25.1

_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

* Re: [Intel-wired-lan] [PATCH net-next] ice: Remove unnecessary NULL check before dev_put
  2022-06-16  4:52 [Intel-wired-lan] [PATCH net-next] ice: Remove unnecessary NULL check before dev_put Ziyang Xuan
@ 2022-06-29 12:44 ` G, GurucharanX
  0 siblings, 0 replies; 2+ messages in thread
From: G, GurucharanX @ 2022-06-29 12:44 UTC (permalink / raw)
  To: Ziyang Xuan, Brandeburg, Jesse, Nguyen, Anthony L, davem,
	edumazet, kuba, pabeni, intel-wired-lan, netdev



> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Ziyang Xuan
> Sent: Thursday, June 16, 2022 10:23 AM
> To: Brandeburg, Jesse <jesse.brandeburg@intel.com>; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; davem@davemloft.net;
> edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; intel-
> wired-lan@lists.osuosl.org; netdev@vger.kernel.org
> Subject: [Intel-wired-lan] [PATCH net-next] ice: Remove unnecessary NULL
> check before dev_put
> 
> Since commit b37a46683739 ("netdevice: add the case if dev is NULL"),
> dev_put(NULL) is safe, check NULL before dev_put() is not needed.
> 
> Signed-off-by: Ziyang Xuan <william.xuanziyang@huawei.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_lag.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 

Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan

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

end of thread, other threads:[~2022-06-29 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-16  4:52 [Intel-wired-lan] [PATCH net-next] ice: Remove unnecessary NULL check before dev_put Ziyang Xuan
2022-06-29 12:44 ` G, GurucharanX

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