Commit 6745bc9b authored by Yang Yingliang's avatar Yang Yingliang Committed by Jakub Kicinski

amt: remove unnecessary skb pointer check

The skb pointer will be checked in kfree_skb(), so remove the outside check.
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: default avatarTaehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20220818093114.2449179-1-yangyingliang@huawei.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b690842d
...@@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work) ...@@ -2894,8 +2894,7 @@ static void amt_event_work(struct work_struct *work)
amt_event_send_request(amt); amt_event_send_request(amt);
break; break;
default: default:
if (skb) kfree_skb(skb);
kfree_skb(skb);
break; break;
} }
} }
...@@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev) ...@@ -3033,8 +3032,7 @@ static int amt_dev_stop(struct net_device *dev)
cancel_work_sync(&amt->event_wq); cancel_work_sync(&amt->event_wq);
for (i = 0; i < AMT_MAX_EVENTS; i++) { for (i = 0; i < AMT_MAX_EVENTS; i++) {
skb = amt->events[i].skb; skb = amt->events[i].skb;
if (skb) kfree_skb(skb);
kfree_skb(skb);
amt->events[i].event = AMT_EVENT_NONE; amt->events[i].event = AMT_EVENT_NONE;
amt->events[i].skb = NULL; amt->events[i].skb = NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment