* [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events
@ 2018-02-16 9:18 Xin Long
2018-02-16 10:19 ` Marcelo Ricardo Leitner
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xin Long @ 2018-02-16 9:18 UTC (permalink / raw)
To: network dev, linux-sctp
Cc: davem, Marcelo Ricardo Leitner, Neil Horman, Dan Carpenter
Commit fb23403536ea ("sctp: remove the useless check in
sctp_renege_events") forgot to remove another check for
chunk in sctp_renege_events.
Dan found this when doing a static check.
This patch is to remove that check, and also to merge
two checks into one 'if statement'.
Fixes: fb23403536ea ("sctp: remove the useless check in sctp_renege_events")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/sctp/stream_interleave.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
index 65ac03b..d3764c1 100644
--- a/net/sctp/stream_interleave.c
+++ b/net/sctp/stream_interleave.c
@@ -968,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
needed);
}
- if (chunk && freed >= needed)
- if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
- sctp_intl_start_pd(ulpq, gfp);
+ if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
+ sctp_intl_start_pd(ulpq, gfp);
sk_mem_reclaim(asoc->base.sk);
}
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events
2018-02-16 9:18 [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Xin Long
@ 2018-02-16 10:19 ` Marcelo Ricardo Leitner
2018-02-16 12:26 ` Neil Horman
2018-02-16 21:32 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Marcelo Ricardo Leitner @ 2018-02-16 10:19 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, linux-sctp, davem, Neil Horman, Dan Carpenter
On Fri, Feb 16, 2018 at 05:18:33PM +0800, Xin Long wrote:
> Commit fb23403536ea ("sctp: remove the useless check in
> sctp_renege_events") forgot to remove another check for
> chunk in sctp_renege_events.
>
> Dan found this when doing a static check.
>
> This patch is to remove that check, and also to merge
> two checks into one 'if statement'.
>
> Fixes: fb23403536ea ("sctp: remove the useless check in sctp_renege_events")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
> ---
> net/sctp/stream_interleave.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
> index 65ac03b..d3764c1 100644
> --- a/net/sctp/stream_interleave.c
> +++ b/net/sctp/stream_interleave.c
> @@ -968,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
> needed);
> }
>
> - if (chunk && freed >= needed)
> - if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
> - sctp_intl_start_pd(ulpq, gfp);
> + if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
> + sctp_intl_start_pd(ulpq, gfp);
>
> sk_mem_reclaim(asoc->base.sk);
> }
> --
> 2.1.0
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events
2018-02-16 9:18 [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Xin Long
2018-02-16 10:19 ` Marcelo Ricardo Leitner
@ 2018-02-16 12:26 ` Neil Horman
2018-02-16 21:32 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Neil Horman @ 2018-02-16 12:26 UTC (permalink / raw)
To: Xin Long
Cc: network dev, linux-sctp, davem, Marcelo Ricardo Leitner,
Dan Carpenter
On Fri, Feb 16, 2018 at 05:18:33PM +0800, Xin Long wrote:
> Commit fb23403536ea ("sctp: remove the useless check in
> sctp_renege_events") forgot to remove another check for
> chunk in sctp_renege_events.
>
> Dan found this when doing a static check.
>
> This patch is to remove that check, and also to merge
> two checks into one 'if statement'.
>
> Fixes: fb23403536ea ("sctp: remove the useless check in sctp_renege_events")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/sctp/stream_interleave.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/net/sctp/stream_interleave.c b/net/sctp/stream_interleave.c
> index 65ac03b..d3764c1 100644
> --- a/net/sctp/stream_interleave.c
> +++ b/net/sctp/stream_interleave.c
> @@ -968,9 +968,8 @@ static void sctp_renege_events(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
> needed);
> }
>
> - if (chunk && freed >= needed)
> - if (sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
> - sctp_intl_start_pd(ulpq, gfp);
> + if (freed >= needed && sctp_ulpevent_idata(ulpq, chunk, gfp) <= 0)
> + sctp_intl_start_pd(ulpq, gfp);
>
> sk_mem_reclaim(asoc->base.sk);
> }
> --
> 2.1.0
>
>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events
2018-02-16 9:18 [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Xin Long
2018-02-16 10:19 ` Marcelo Ricardo Leitner
2018-02-16 12:26 ` Neil Horman
@ 2018-02-16 21:32 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2018-02-16 21:32 UTC (permalink / raw)
To: lucien.xin; +Cc: netdev, linux-sctp, marcelo.leitner, nhorman, dan.carpenter
From: Xin Long <lucien.xin@gmail.com>
Date: Fri, 16 Feb 2018 17:18:33 +0800
> Commit fb23403536ea ("sctp: remove the useless check in
> sctp_renege_events") forgot to remove another check for
> chunk in sctp_renege_events.
>
> Dan found this when doing a static check.
>
> This patch is to remove that check, and also to merge
> two checks into one 'if statement'.
>
> Fixes: fb23403536ea ("sctp: remove the useless check in sctp_renege_events")
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-16 21:32 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-16 9:18 [PATCH net] sctp: remove the left unnecessary check for chunk in sctp_renege_events Xin Long
2018-02-16 10:19 ` Marcelo Ricardo Leitner
2018-02-16 12:26 ` Neil Horman
2018-02-16 21:32 ` David Miller
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).