diff options
author | Alexey Kodanev <aleksei.kodanev@bell-sw.com> | 2022-10-19 20:07:35 +0200 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2022-10-21 06:43:10 +0200 |
commit | 377eb9aab084bf298eed9b55ba173dad36fdf7f2 (patch) | |
tree | 8227cac26bc39e685754cde3bbb569af34a4fdf0 /net/sctp/stream_interleave.c | |
parent | sctp: remove unnecessary NULL check in sctp_ulpq_tail_event() (diff) | |
download | linux-377eb9aab084bf298eed9b55ba173dad36fdf7f2.tar.xz linux-377eb9aab084bf298eed9b55ba173dad36fdf7f2.zip |
sctp: remove unnecessary NULL checks in sctp_enqueue_event()
After commit 178ca044aa60 ("sctp: Make sctp_enqueue_event tak an
skb list."), skb_list cannot be NULL.
Detected using the static analysis tool - Svace.
Signed-off-by: Alexey Kodanev <aleksei.kodanev@bell-sw.com>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
Link: https://lore.kernel.org/r/20221019180735.161388-3-aleksei.kodanev@bell-sw.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to '')
-rw-r--r-- | net/sctp/stream_interleave.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c index bb22b71df7a3..94727feb07b3 100644 --- a/net/sctp/stream_interleave.c +++ b/net/sctp/stream_interleave.c @@ -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; } |