mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 01:51:53 +00:00
mfd: Ensure value written by wm831x_set_bits() is within the mask
Purely for defensiveness. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
ec2328c30b
commit
b00cd68eb3
@ -295,7 +295,7 @@ int wm831x_set_bits(struct wm831x *wm831x, unsigned short reg,
|
||||
goto out;
|
||||
|
||||
r &= ~mask;
|
||||
r |= val;
|
||||
r |= val & mask;
|
||||
|
||||
ret = wm831x_write(wm831x, reg, 2, &r);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user