summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-04-13 22:47:48 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2017-04-24 22:42:23 +0300
commit3fcc78340f3a9bef2be7ad54258b06e1f177d3fd (patch)
tree5b673462b84d01516da8e17847c851b6a0e91ccf /drivers/mmc
parentfe79018aa4c3af7d74e48b9a9b117da9fb6cf353 (diff)
downloadlinux-3fcc78340f3a9bef2be7ad54258b06e1f177d3fd.tar.xz
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>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/cavium.c2
1 files changed, 1 insertions, 1 deletions
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;