Skip to content

Commit f794dc2

Browse files
lxindavem330
authored andcommitted
sctp: fix the missing put_user when dumping transport thresholds
This issue causes SCTP_PEER_ADDR_THLDS sockopt not to be able to dump a transport thresholds info. Fix it by adding 'goto' put_user in sctp_getsockopt_paddr_thresholds. Fixes: 8add543 ("sctp: add SCTP_FUTURE_ASSOC for SCTP_PEER_ADDR_THLDS sockopt") Signed-off-by: Xin Long <[email protected]> Acked-by: Marcelo Ricardo Leitner <[email protected]> Acked-by: Neil Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d4d6ec6 commit f794dc2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/sctp/socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7173,7 +7173,7 @@ static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
71737173
val.spt_pathmaxrxt = trans->pathmaxrxt;
71747174
val.spt_pathpfthld = trans->pf_retrans;
71757175

7176-
return 0;
7176+
goto out;
71777177
}
71787178

71797179
asoc = sctp_id2assoc(sk, val.spt_assoc_id);
@@ -7191,6 +7191,7 @@ static int sctp_getsockopt_paddr_thresholds(struct sock *sk,
71917191
val.spt_pathmaxrxt = sp->pathmaxrxt;
71927192
}
71937193

7194+
out:
71947195
if (put_user(len, optlen) || copy_to_user(optval, &val, len))
71957196
return -EFAULT;
71967197

0 commit comments

Comments
 (0)