projects
/
GitHub
/
LineageOS
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fe79018
)
mmc: cavium: Fix a shift wrapping bug
author
Dan Carpenter
<dan.carpenter@oracle.com>
Thu, 13 Apr 2017 19:47:48 +0000
(22:47 +0300)
committer
Ulf Hansson
<ulf.hansson@linaro.org>
Mon, 24 Apr 2017 19:42:23 +0000
(21:42 +0200)
"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>
drivers/mmc/host/cavium.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/mmc/host/cavium.c
b/drivers/mmc/host/cavium.c
index d89c2ebcad90d773d1c94c2f3cfe15e87ee8c63f..d89c011bbea8bf334329ffd836ba94722899f775 100644
(file)
--- 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;