提交 3fcc7834 编写于 作者: D Dan Carpenter 提交者: Ulf Hansson

mmc: cavium: Fix a shift wrapping bug

"dat" is a u64 and "shift" starts as 54 so this is a shift wrapping bug.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
上级 fe79018a
......@@ -733,7 +733,7 @@ static void do_write_request(struct cvm_mmc_host *host, struct mmc_request *mrq)
}
while (smi->consumed < smi->length && shift >= 0) {
dat |= ((u8 *)smi->addr)[smi->consumed] << shift;
dat |= (u64)((u8 *)smi->addr)[smi->consumed] << shift;
bytes_xfered++;
smi->consumed++;
shift -= 8;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册