Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mfd: 88pm80x: Double shifting bug in suspend/resume

set_bit() and clear_bit() take the bit number so this code is really
doing "1 << (1 << irq)" which is a double shift bug. It's done
consistently so it won't cause a problem unless "irq" is more than 4.

Fixes: 70c6cce04066 ('mfd: Support 88pm80x in 80x driver')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Dan Carpenter and committed by
Lee Jones
9a6dc644 7f70495a

+2 -2
+2 -2
include/linux/mfd/88pm80x.h
··· 350 350 int irq = platform_get_irq(pdev, 0); 351 351 352 352 if (device_may_wakeup(dev)) 353 - set_bit((1 << irq), &chip->wu_flag); 353 + set_bit(irq, &chip->wu_flag); 354 354 355 355 return 0; 356 356 } ··· 362 362 int irq = platform_get_irq(pdev, 0); 363 363 364 364 if (device_may_wakeup(dev)) 365 - clear_bit((1 << irq), &chip->wu_flag); 365 + clear_bit(irq, &chip->wu_flag); 366 366 367 367 return 0; 368 368 }