From 3fcc78340f3a9bef2be7ad54258b06e1f177d3fd Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 13 Apr 2017 22:47:48 +0300 Subject: [PATCH] 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 --- drivers/mmc/host/cavium.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1