ice: Remove unnecessary NULL check before dev_put

Since commit b37a466837 ("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>
This commit is contained in:
Ziyang Xuan 2022-06-16 12:52:59 +08:00 committed by Tony Nguyen
parent 0ca8582990
commit afa646299a

View 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);