ice: Remove unnecessary NULL check before dev_put
authorZiyang Xuan <william.xuanziyang@huawei.com>
Thu, 16 Jun 2022 04:52:59 +0000 (12:52 +0800)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 30 Jun 2022 20:53:33 +0000 (13:53 -0700)
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>
drivers/net/ethernet/intel/ice/ice_lag.c

index 4f954db..c9f7393 100644 (file)
@@ -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);