提交 6745bc9b 编写于 作者: Y Yang Yingliang 提交者: 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: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NTaehee Yoo <ap420073@gmail.com>
Link: https://lore.kernel.org/r/20220818093114.2449179-1-yangyingliang@huawei.comSigned-off-by: NJakub Kicinski <kuba@kernel.org>
上级 b690842d
......@@ -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;
}
}
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册