Skip to content

Commit

Permalink
amt: remove unnecessary skb pointer check
Browse files Browse the repository at this point in the history
The skb pointer will be checked in kfree_skb(), so remove the outside check.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Taehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20220818093114.2449179-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Yang Yingliang authored and Jakub Kicinski committed Aug 19, 2022
1 parent b690842 commit 6745bc9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/net/amt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work)
amt_event_send_request(amt);
break;
default:
if (skb)
kfree_skb(skb);
kfree_skb(skb);
break;
}
}
Expand Down Expand Up @@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev)
cancel_work_sync(&amt->event_wq);
for (i = 0; i < AMT_MAX_EVENTS; i++) {
skb = amt->events[i].skb;
if (skb)
kfree_skb(skb);
kfree_skb(skb);
amt->events[i].event = AMT_EVENT_NONE;
amt->events[i].skb = NULL;
}
Expand Down

0 comments on commit 6745bc9

Please sign in to comment.