Commit 3fcc7834 authored by Dan Carpenter's avatar Dan Carpenter Committed by 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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment