提交 6d8e9dd0 编写于 作者: B Bryan O'Sullivan 提交者: Linus Torvalds

[PATCH] IB/ipath: read/write correct sizes through diag interface

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: NDave Olson <dave.olson@qlogic.com>
Signed-off-by: NBryan O'Sullivan <bryan.osullivan@qlogic.com>
Cc: "Michael S. Tsirkin" <mst@mellanox.co.il>
Cc: Roland Dreier <rolandd@cisco.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 8307c28e
......@@ -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:
......@@ -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:
......@@ -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:
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册