Skip to content

Commit

Permalink
[PATCH] IB/ipath: read/write correct sizes through diag interface
Browse files Browse the repository at this point in the history
We must increment uaddr by size we are reading or writing, since it's passed
as a char *, not a pointer to the appropriate size.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Bryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Bryan O'Sullivan authored and Linus Torvalds committed Jul 1, 2006
1 parent 8307c28 commit 6d8e9dd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/infiniband/hw/ipath/ipath_diag.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ static int ipath_read_umem64(struct ipath_devdata *dd, void __user *uaddr,
goto bail;
}
reg_addr++;
uaddr++;
uaddr += sizeof(u64);
}
ret = 0;
bail:
Expand Down Expand Up @@ -154,7 +154,7 @@ static int ipath_write_umem64(struct ipath_devdata *dd, void __iomem *caddr,
writeq(data, reg_addr);

reg_addr++;
uaddr++;
uaddr += sizeof(u64);
}
ret = 0;
bail:
Expand Down Expand Up @@ -192,7 +192,8 @@ static int ipath_read_umem32(struct ipath_devdata *dd, void __user *uaddr,
}

reg_addr++;
uaddr++;
uaddr += sizeof(u32);

}
ret = 0;
bail:
Expand Down Expand Up @@ -231,7 +232,7 @@ static int ipath_write_umem32(struct ipath_devdata *dd, void __iomem *caddr,
writel(data, reg_addr);

reg_addr++;
uaddr++;
uaddr += sizeof(u32);
}
ret = 0;
bail:
Expand Down

0 comments on commit 6d8e9dd

Please sign in to comment.