projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7ce5eac
)
IB/ipath: Allow old and new diagnostic packet formats
author
Michael Albaugh
<
[email protected]
>
Thu, 17 Apr 2008 04:09:28 +0000
(21:09 -0700)
committer
Roland Dreier
<
[email protected]
>
Thu, 17 Apr 2008 04:09:28 +0000
(21:09 -0700)
This patch checks for old and new format writes to send a packet via the
diagnostic interface.
Signed-off-by: Michael Albaugh <
[email protected]
>
Signed-off-by: Roland Dreier <
[email protected]
>
drivers/infiniband/hw/ipath/ipath_diag.c
patch
|
blob
|
history
diff --git
a/drivers/infiniband/hw/ipath/ipath_diag.c
b/drivers/infiniband/hw/ipath/ipath_diag.c
index af59bf380ca265375e5605c24f75fa058f38785f..c9bfd827e71b9ff5def9d420d370873edc726cf6 100644
(file)
--- a/
drivers/infiniband/hw/ipath/ipath_diag.c
+++ b/
drivers/infiniband/hw/ipath/ipath_diag.c
@@
-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(o
dp)) {
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;
}