aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--net/sctp/socket.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index a5b6e559451..45510c46c22 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -4352,11 +4352,12 @@ copy_getaddrs:
err = -EFAULT;
goto error;
}
- if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num))
- return -EFAULT;
+ if (put_user(cnt, &((struct sctp_getaddrs __user *)optval)->addr_num)) {
+ err = -EFAULT;
+ goto error;
+ }
if (put_user(bytes_copied, optlen))
- return -EFAULT;
-
+ err = -EFAULT;
error:
kfree(addrs);
return err;