Skip to content

Commit

Permalink
ice: Remove unnecessary NULL check before dev_put
Browse files Browse the repository at this point in the history
Since commit b37a466 ("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>
  • Loading branch information
Ziyang Xuan authored and Tony Nguyen committed Jun 30, 2022
1 parent 0ca8582 commit afa6462
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/ethernet/intel/ice/ice_lag.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit afa6462

Please sign in to comment.