Re: [PATCH] sctp: avoid overwrite the return value of sctp_process_asconf_ack()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Wei Yongjun wrote:
> The return value of sctp_process_asconf_ack() may be
> overwritten while process parameters with no error.
> This patch fixed the problem.
> 
> Signed-off-by: Wei Yongjun <yjwei@xxxxxxxxxxxxxx>
> ---
>  net/sctp/sm_make_chunk.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
> index ab91712..06ad732 100644
> --- a/net/sctp/sm_make_chunk.c
> +++ b/net/sctp/sm_make_chunk.c
> @@ -3271,7 +3271,8 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
>  
>  		switch (err_code) {
>  		case SCTP_ERROR_NO_ERROR:
> -			retval = sctp_asconf_param_success(asoc, asconf_param);
> +			if (sctp_asconf_param_success(asoc, asconf_param))
> +				retval = 1;
>  			break;
>  
>  		case SCTP_ERROR_RSRC_LOW:

Hmm... As long as you are cleaning up, looks like sctp_asconf_param_success
can easily become a void and we avoid this whole thing.  Right now, that function
will never return 'TRUE'.

-vlad
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux