sctp: make use of pre-calculated len
authorMarcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Mon, 8 Jan 2018 21:02:29 +0000 (19:02 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 3 Mar 2018 09:23:28 +0000 (10:23 +0100)
commitb923c86a7c6b63c0bdb410c667038e906a6c3e24
tree80b590904dc022768d975683627e44a7c30a16e1
parentc65c0dfb27914e141be8193d509fcd4e6387d13c
sctp: make use of pre-calculated len

[ Upstream commit c76f97c99ae6d26d14c7f0e50e074382bfbc9f98 ]

Some sockopt handling functions were calculating the length of the
buffer to be written to userspace and then calculating it again when
actually writing the buffer, which could lead to some write not using
an up-to-date length.

This patch updates such places to just make use of the len variable.

Also, replace some sizeof(type) to sizeof(var).

Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/sctp/socket.c