From: Dan Carpenter Date: Thu, 13 Apr 2017 19:47:48 +0000 (+0300) Subject: mmc: cavium: Fix a shift wrapping bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3fcc78340f3a9bef2be7ad54258b06e1f177d3fd;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/cavium.c b/drivers/mmc/host/cavium.c index d89c2ebcad90..d89c011bbea8 100644 --- a/drivers/mmc/host/cavium.c +++ b/drivers/mmc/host/cavium.c @@ -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;