Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208451
b: refs/heads/master
c: 89596f2
h: refs/heads/master
i:
  208449: 14c03a4
  208447: f9b09b5
v: v3
  • Loading branch information
Kulikov Vasiliy authored and Linus Torvalds committed Aug 11, 2010
1 parent a05a0c2 commit b7fcb6c
Show file tree
Hide file tree
Showing 2 changed files with 10 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: d929dc2bfd8a58c34f1df0680018fa8ea5caa907
refs/heads/master: 89596f20bb5f0f32c37abd337d995080e04519c8
16 changes: 9 additions & 7 deletions trunk/drivers/message/i2o/i2o_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ static int i2o_cfg_gethrt(unsigned long arg)

len = 8 + ((hrt->entry_len * hrt->num_entries) << 2);

/* We did a get user...so assuming mem is ok...is this bad? */
put_user(len, kcmd.reslen);
if (len > reslen)
if (put_user(len, kcmd.reslen))
ret = -EFAULT;
else if (len > reslen)
ret = -ENOBUFS;
else if (copy_to_user(kcmd.resbuf, (void *)hrt, len))
ret = -EFAULT;
Expand Down Expand Up @@ -147,8 +147,9 @@ static int i2o_cfg_getlct(unsigned long arg)
lct = (i2o_lct *) c->lct;

len = (unsigned int)lct->table_size << 2;
put_user(len, kcmd.reslen);
if (len > reslen)
if (put_user(len, kcmd.reslen))
ret = -EFAULT;
else if (len > reslen)
ret = -ENOBUFS;
else if (copy_to_user(kcmd.resbuf, lct, len))
ret = -EFAULT;
Expand Down Expand Up @@ -208,8 +209,9 @@ static int i2o_cfg_parms(unsigned long arg, unsigned int type)
return -EAGAIN;
}

put_user(len, kcmd.reslen);
if (len > reslen)
if (put_user(len, kcmd.reslen))
ret = -EFAULT;
else if (len > reslen)
ret = -ENOBUFS;
else if (copy_to_user(kcmd.resbuf, res, len))
ret = -EFAULT;
Expand Down

0 comments on commit b7fcb6c

Please sign in to comment.