Commit 377eb9aa authored by Alexey Kodanev's avatar Alexey Kodanev Committed by Jakub Kicinski

sctp: remove unnecessary NULL checks in sctp_enqueue_event()

After commit 178ca044 ("sctp: Make sctp_enqueue_event tak an
skb list."), skb_list cannot be NULL.

Detected using the static analysis tool - Svace.
Signed-off-by: default avatarAlexey Kodanev <aleksei.kodanev@bell-sw.com>
Reviewed-by: default avatarXin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20221019180735.161388-3-aleksei.kodanev@bell-sw.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b66aeddb
......@@ -490,11 +490,8 @@ static int sctp_enqueue_event(struct sctp_ulpq *ulpq,
if (!sctp_ulpevent_is_enabled(event, ulpq->asoc->subscribe))
goto out_free;
if (skb_list)
skb_queue_splice_tail_init(skb_list,
&sk->sk_receive_queue);
else
__skb_queue_tail(&sk->sk_receive_queue, skb);
skb_queue_splice_tail_init(skb_list,
&sk->sk_receive_queue);
if (!sp->data_ready_signalled) {
sp->data_ready_signalled = 1;
......@@ -504,10 +501,7 @@ static int sctp_enqueue_event(struct sctp_ulpq *ulpq,
return 1;
out_free:
if (skb_list)
sctp_queue_purge_ulpevents(skb_list);
else
sctp_ulpevent_free(event);
sctp_queue_purge_ulpevents(skb_list);
return 0;
}
......
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