Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279119
b: refs/heads/master
c: 32288eb
h: refs/heads/master
i:
  279117: 240878a
  279115: deeb829
  279111: a74c614
  279103: 5a46b72
v: v3
  • Loading branch information
Xi Wang authored and David S. Miller committed Dec 28, 2011
1 parent a6d4fb3 commit 5b9661e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba1cffe0257bcd4d0070bc0e64f8ead97fefd148
refs/heads/master: 32288eb4d940b10e40c6d4178fe3a40d1437d2f8
14 changes: 7 additions & 7 deletions trunk/net/netrom/af_netrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,26 +306,26 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
{
struct sock *sk = sock->sk;
struct nr_sock *nr = nr_sk(sk);
int opt;
unsigned long opt;

if (level != SOL_NETROM)
return -ENOPROTOOPT;

if (optlen < sizeof(int))
if (optlen < sizeof(unsigned int))
return -EINVAL;

if (get_user(opt, (int __user *)optval))
if (get_user(opt, (unsigned int __user *)optval))
return -EFAULT;

switch (optname) {
case NETROM_T1:
if (opt < 1)
if (opt < 1 || opt > ULONG_MAX / HZ)
return -EINVAL;
nr->t1 = opt * HZ;
return 0;

case NETROM_T2:
if (opt < 1)
if (opt < 1 || opt > ULONG_MAX / HZ)
return -EINVAL;
nr->t2 = opt * HZ;
return 0;
Expand All @@ -337,13 +337,13 @@ static int nr_setsockopt(struct socket *sock, int level, int optname,
return 0;

case NETROM_T4:
if (opt < 1)
if (opt < 1 || opt > ULONG_MAX / HZ)
return -EINVAL;
nr->t4 = opt * HZ;
return 0;

case NETROM_IDLE:
if (opt < 0)
if (opt > ULONG_MAX / (60 * HZ))
return -EINVAL;
nr->idle = opt * 60 * HZ;
return 0;
Expand Down

0 comments on commit 5b9661e

Please sign in to comment.