Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc82673f authored by Wei Yongjun's avatar Wei Yongjun Committed by David S. Miller
Browse files

sctp: fix error return code in sctp_send_add_streams()



Fix to returnerror code -ENOMEM from the sctp_make_strreset_addstrm()
error handling case instead of 0. 'retval' can be overwritten to 0 after
call sctp_stream_alloc_out().

Fixes: e090abd0 ("sctp: factor out stream->out allocation")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Acked-by: default avatarNeil Horman <nhorman@tuxdriver.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 85cf7a62
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -393,7 +393,7 @@ int sctp_send_add_streams(struct sctp_association *asoc,
{
	struct sctp_stream *stream = &asoc->stream;
	struct sctp_chunk *chunk = NULL;
	int retval = -ENOMEM;
	int retval;
	__u32 outcnt, incnt;
	__u16 out, in;

@@ -425,8 +425,10 @@ int sctp_send_add_streams(struct sctp_association *asoc,
	}

	chunk = sctp_make_strreset_addstrm(asoc, out, in);
	if (!chunk)
	if (!chunk) {
		retval = -ENOMEM;
		goto out;
	}

	asoc->strreset_chunk = chunk;
	sctp_chunk_hold(asoc->strreset_chunk);