* [PATCH net-next] sctp: Remove redundant skb_list null check
@ 2021-04-29 10:19 wangyunjian
2021-04-30 0:45 ` Marcelo Ricardo Leitner
2021-04-30 21:22 ` Xin Long
0 siblings, 2 replies; 3+ messages in thread
From: wangyunjian @ 2021-04-29 10:19 UTC (permalink / raw)
To: kuba, davem
Cc: vyasevich, nhorman, marcelo.leitner, linux-sctp, netdev,
dingxiaoxiong, Yunjian Wang
From: Yunjian Wang <wangyunjian@huawei.com>
The skb_list cannot be NULL here since its already being accessed
before. Remove the redundant null check.
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
---
net/sctp/ulpqueue.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index 407fed46931b..6f3685f0e700 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -259,10 +259,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sk_buff_head *skb_list)
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;
}
--
2.23.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sctp: Remove redundant skb_list null check
2021-04-29 10:19 [PATCH net-next] sctp: Remove redundant skb_list null check wangyunjian
@ 2021-04-30 0:45 ` Marcelo Ricardo Leitner
2021-04-30 21:22 ` Xin Long
1 sibling, 0 replies; 3+ messages in thread
From: Marcelo Ricardo Leitner @ 2021-04-30 0:45 UTC (permalink / raw)
To: wangyunjian
Cc: kuba, davem, vyasevich, nhorman, linux-sctp, netdev, dingxiaoxiong
On Thu, Apr 29, 2021 at 06:19:49PM +0800, wangyunjian wrote:
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> The skb_list cannot be NULL here since its already being accessed
> before. Remove the redundant null check.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] sctp: Remove redundant skb_list null check
2021-04-29 10:19 [PATCH net-next] sctp: Remove redundant skb_list null check wangyunjian
2021-04-30 0:45 ` Marcelo Ricardo Leitner
@ 2021-04-30 21:22 ` Xin Long
1 sibling, 0 replies; 3+ messages in thread
From: Xin Long @ 2021-04-30 21:22 UTC (permalink / raw)
To: wangyunjian
Cc: Jakub Kicinski, davem, Vlad Yasevich, Neil Horman,
Marcelo Ricardo Leitner, linux-sctp @ vger . kernel . org,
network dev, dingxiaoxiong
On Thu, Apr 29, 2021 at 6:20 AM wangyunjian <wangyunjian@huawei.com> wrote:
>
> From: Yunjian Wang <wangyunjian@huawei.com>
>
> The skb_list cannot be NULL here since its already being accessed
> before. Remove the redundant null check.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
> net/sctp/ulpqueue.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
> index 407fed46931b..6f3685f0e700 100644
> --- a/net/sctp/ulpqueue.c
> +++ b/net/sctp/ulpqueue.c
> @@ -259,10 +259,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sk_buff_head *skb_list)
> 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;
> }
> --
> 2.23.0
>
Reviewed-by: Xin Long <lucien.xin@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-04-30 21:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-29 10:19 [PATCH net-next] sctp: Remove redundant skb_list null check wangyunjian
2021-04-30 0:45 ` Marcelo Ricardo Leitner
2021-04-30 21:22 ` Xin Long
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).