Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 279118
b: refs/heads/master
c: ba1cffe
h: refs/heads/master
v: v3
  • Loading branch information
Xi Wang authored and David S. Miller committed Dec 28, 2011
1 parent 240878a commit a6d4fb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 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: fa84309533025eb3f03dc1d2d2be1c3ca206882a
refs/heads/master: ba1cffe0257bcd4d0070bc0e64f8ead97fefd148
11 changes: 6 additions & 5 deletions trunk/net/ax25/af_ax25.c
Original file line number Diff line number Diff line change
Expand Up @@ -545,15 +545,16 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
ax25_cb *ax25;
struct net_device *dev;
char devname[IFNAMSIZ];
int opt, res = 0;
unsigned long opt;
int res = 0;

if (level != SOL_AX25)
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;

lock_sock(sk);
Expand Down Expand Up @@ -609,15 +610,15 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
break;

case AX25_IDLE:
if (opt < 0 || opt > ULONG_MAX / (60 * HZ)) {
if (opt > ULONG_MAX / (60 * HZ)) {
res = -EINVAL;
break;
}
ax25->idle = opt * 60 * HZ;
break;

case AX25_BACKOFF:
if (opt < 0 || opt > 2) {
if (opt > 2) {
res = -EINVAL;
break;
}
Expand Down

0 comments on commit a6d4fb3

Please sign in to comment.