mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 23:24:22 -04:00
Staging: Gasket: shift wrapping bug in gasket_read_modify_write_64()
This function only has one caller so mask_width is 1 and mask_shift is
32. Shifting an int by 32 bits is undefined, but I guess on GCC it
wraps to 0x1? Anyway it's supposed to be 0x100000000.
Fixes: 9a69f5087c ("drivers/staging: Gasket driver framework + Apex driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7cc6dfd076
commit
c37a192ef4
1 changed files with 1 additions and 1 deletions
|
|
@ -683,7 +683,7 @@ static inline void gasket_read_modify_write_64(
|
|||
u64 mask, tmp;
|
||||
|
||||
tmp = gasket_dev_read_64(dev, bar, location);
|
||||
mask = ((1 << mask_width) - 1) << mask_shift;
|
||||
mask = ((1ULL << mask_width) - 1) << mask_shift;
|
||||
tmp = (tmp & ~mask) | (value << mask_shift);
|
||||
gasket_dev_write_64(dev, tmp, bar, location);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue