diff mbox series

[net-next] sctp: Remove redundant skb_list null check

Message ID 1619691589-4776-1-git-send-email-wangyunjian@huawei.com (mailing list archive)
State Deferred
Delegated to: Netdev Maintainers
Headers show
Series [net-next] sctp: Remove redundant skb_list null check | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 7 of 7 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 37 this patch: 37
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 11 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 30 this patch: 30
netdev/header_inline success Link

Commit Message

wangyunjian April 29, 2021, 10:19 a.m. UTC
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(-)

Comments

Marcelo Ricardo Leitner April 30, 2021, 12:45 a.m. UTC | #1
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>
Xin Long April 30, 2021, 9:22 p.m. UTC | #2
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>
diff mbox series

Patch

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;
 }