diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-04-13 22:47:48 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2017-04-24 21:42:23 +0200 |
commit | 3fcc78340f3a9bef2be7ad54258b06e1f177d3fd (patch) | |
tree | 5b673462b84d01516da8e17847c851b6a0e91ccf /drivers/mmc | |
parent | fe79018aa4c3af7d74e48b9a9b117da9fb6cf353 (diff) | |
download | talos-obmc-linux-3fcc78340f3a9bef2be7ad54258b06e1f177d3fd.tar.gz talos-obmc-linux-3fcc78340f3a9bef2be7ad54258b06e1f177d3fd.zip |
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.c | 2 |
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; |