Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88520
b: refs/heads/master
c: afd9970
h: refs/heads/master
v: v3
  • Loading branch information
Michael Albaugh authored and Roland Dreier committed Apr 17, 2008
1 parent d81fffa commit 558724a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 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: 7ce5eacb45a7c819a6bec6ed486f27db9aab6ab6
refs/heads/master: afd9970f957454782795b23c89fd6d7dde973cc0
9 changes: 7 additions & 2 deletions trunk/drivers/infiniband/hw/ipath/ipath_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,17 @@ static ssize_t ipath_diagpkt_write(struct file *fp,
u64 val;
u32 l_state, lt_state; /* LinkState, LinkTrainingState */

if (count != sizeof(dp)) {
if (count < sizeof(odp)) {
ret = -EINVAL;
goto bail;
}

if (copy_from_user(&dp, data, sizeof(dp))) {
if (count == sizeof(dp)) {
if (copy_from_user(&dp, data, sizeof(dp))) {
ret = -EFAULT;
goto bail;
}
} else if (copy_from_user(&odp, data, sizeof(odp))) {
ret = -EFAULT;
goto bail;
}
Expand Down

0 comments on commit 558724a

Please sign in to comment.