diff options
-rw-r--r-- | net/sctp/socket.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d2681a6bc6fa..71513b3926a5 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2086,6 +2086,9 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval, | |||
2086 | return -EINVAL; | 2086 | return -EINVAL; |
2087 | if (copy_from_user(&sp->autoclose, optval, optlen)) | 2087 | if (copy_from_user(&sp->autoclose, optval, optlen)) |
2088 | return -EFAULT; | 2088 | return -EFAULT; |
2089 | /* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */ | ||
2090 | if (sp->autoclose > (MAX_SCHEDULE_TIMEOUT / HZ) ) | ||
2091 | sp->autoclose = MAX_SCHEDULE_TIMEOUT / HZ ; | ||
2089 | 2092 | ||
2090 | return 0; | 2093 | return 0; |
2091 | } | 2094 | } |