mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-30 16:13:54 +08:00
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:
parent
fe79018aa4
commit
3fcc78340f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user