diff options
author | Ziyang Xuan <william.xuanziyang@huawei.com> | 2022-06-16 07:52:59 +0300 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2022-06-30 23:53:33 +0300 |
commit | afa646299a282c5e621242c2db8c95c0ccb57d0e (patch) | |
tree | dde1c83196ee8170f5f16b94b29927823186e219 /drivers/net/ethernet/intel/ice/ice_lag.c | |
parent | 0ca85829903f1d4849f2fb463d86ea04d679c98f (diff) | |
download | linux-afa646299a282c5e621242c2db8c95c0ccb57d0e.tar.xz |
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>
Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_lag.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_lag.c | 6 |
1 files 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); |