Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1500995

[PATCH 4.7 10/31] mfd: 88pm80x: Double shifting bug in suspend/resume

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.7 10/31] mfd: 88pm80x: Double shifting bug in suspend/resume
Date 2016-10-14 15:40 +0200
Message-ID <ssaSm-1Q1-39@gated-at.bofh.it> (permalink)
References <ssafE-1n4-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Dan Carpenter <dan.carpenter@oracle.com>

commit 9a6dc644512fd083400a96ac4a035ac154fe6b8d upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 include/linux/mfd/88pm80x.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -350,7 +350,7 @@ static inline int pm80x_dev_suspend(stru
 	int irq = platform_get_irq(pdev, 0);
 
 	if (device_may_wakeup(dev))
-		set_bit((1 << irq), &chip->wu_flag);
+		set_bit(irq, &chip->wu_flag);
 
 	return 0;
 }
@@ -362,7 +362,7 @@ static inline int pm80x_dev_resume(struc
 	int irq = platform_get_irq(pdev, 0);
 
 	if (device_may_wakeup(dev))
-		clear_bit((1 << irq), &chip->wu_flag);
+		clear_bit(irq, &chip->wu_flag);
 
 	return 0;
 }

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.7 00/31] 4.7.8-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:00 +0200
  [PATCH 4.7 17/31] KVM: PPC: BookE: Fix a sanity check Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:00 +0200
  [PATCH 4.7 01/31] powerpc/pseries: use pci_host_bridge.release_fn() to kfree(phb) Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:00 +0200
  [PATCH 4.7 23/31] arch/x86: Handle non enumerated CPU after physical hotplug Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:20 +0200
  [PATCH 4.7 19/31] x86/boot: Fix kdump, cleanup aborted E820_PRAM max_pfn manipulation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:20 +0200
  [PATCH 4.7 22/31] x86/apic: Get rid of apic_version[] array Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:20 +0200
  [PATCH 4.7 05/31] ALSA: ali5451: Fix out-of-bound position reporting Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:20 +0200
  [PATCH 4.7 31/31] tpm_crb: fix crb_req_canceled behavior Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:20 +0200
  [PATCH 4.7 26/31] ARM: dts: mvebu: armada-390: add missing compatibility string and bracket Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  [PATCH 4.7 09/31] mfd: atmel-hlcdc: Do not sleep in atomic context Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  [PATCH 4.7 28/31] ARM: cpuidle: Fix error return code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  [PATCH 4.7 16/31] KVM: arm/arm64: vgic: Dont flush/sync without a working vgic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  [PATCH 4.7 07/31] ALSA: usb-line6: use the same declaration as definition in header for MIDI manufacturer ID Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  [PATCH 4.7 10/31] mfd: 88pm80x: Double shifting bug in suspend/resume Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-10-14 15:40 +0200
  Re: [PATCH 4.7 00/31] 4.7.8-stable review Shuah Khan <shuah.kh@samsung.com> - 2016-10-14 21:00 +0200
  Re: [PATCH 4.7 00/31] 4.7.8-stable review Guenter Roeck <linux@roeck-us.net> - 2016-10-14 21:30 +0200

csiph-web