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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
This commit is contained in:
Dan Carpenter 2017-04-13 22:47:48 +03:00 committed by Ulf Hansson
parent fe79018aa4
commit 3fcc78340f
1 changed files with 1 additions and 1 deletions

View File

@ -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;