linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg KH <gregkh@linuxfoundation.org>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, Lan Tianyu <tianyu.lan@intel.com>,
	Len Brown <len.brown@intel.com>
Subject: [ 18/49] ACPI/AC: prevent OOPS on some boxes due to missing check power_supply_register() return value check
Date: Tue,  7 Aug 2012 15:44:36 -0700	[thread overview]
Message-ID: <20120807222028.519296642@linuxfoundation.org> (raw)
In-Reply-To: <20120807222026.848194739@linuxfoundation.org>

From: Greg KH <gregkh@linuxfoundation.org>

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

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

From: Lan Tianyu <tianyu.lan@intel.com>

commit f197ac13f6eeb351b31250b9ab7d0da17434ea36 upstream.

In the ac.c, power_supply_register()'s return value is not checked.

As a result, the driver's add() ops may return success
even though the device failed to initialize.

For example, some BIOS may describe two ACADs in the same DSDT.
The second ACAD device will fail to register,
but ACPI driver's add() ops returns sucessfully.
The ACPI device will receive ACPI notification and cause OOPS.

https://bugzilla.redhat.com/show_bug.cgi?id=772730

Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/acpi/ac.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/acpi/ac.c
+++ b/drivers/acpi/ac.c
@@ -292,7 +292,9 @@ static int acpi_ac_add(struct acpi_devic
 	ac->charger.properties = ac_props;
 	ac->charger.num_properties = ARRAY_SIZE(ac_props);
 	ac->charger.get_property = get_ac_property;
-	power_supply_register(&ac->device->dev, &ac->charger);
+	result = power_supply_register(&ac->device->dev, &ac->charger);
+	if (result)
+		goto end;
 
 	printk(KERN_INFO PREFIX "%s [%s] (%s)\n",
 	       acpi_device_name(device), acpi_device_bid(device),



  parent reply	other threads:[~2012-08-07 22:46 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-07 22:44 [ 00/49] 3.0.40-stable review Greg Kroah-Hartman
2012-08-07 22:44 ` [ 01/49] mmc: sdhci-pci: CaFe has broken card detection Greg Kroah-Hartman
2012-08-07 22:44 ` [ 02/49] powerpc/ftrace: Fix assembly trampoline register usage Greg Kroah-Hartman
2012-08-07 22:44 ` [ 03/49] powerpc: Add "memory" attribute for mfmsr() Greg Kroah-Hartman
2012-08-07 22:44 ` [ 04/49] powerpc: Fix wrong divisor in usecs_to_cputime Greg Kroah-Hartman
2012-08-07 22:44 ` [ 05/49] SCSI: libsas: continue revalidation Greg Kroah-Hartman
2012-08-07 22:44 ` [ 06/49] SCSI: libsas: fix sas_discover_devices return code handling Greg Kroah-Hartman
2012-08-07 22:44 ` [ 07/49] SCSI: fix eh wakeup (scsi_schedule_eh vs scsi_restart_operations) Greg Kroah-Hartman
2012-08-07 22:44 ` [ 08/49] SCSI: fix hot unplug vs async scan race Greg Kroah-Hartman
2012-08-07 22:44 ` [ 09/49] SCSI: Avoid dangling pointer in scsi_requeue_command() Greg Kroah-Hartman
2012-08-07 22:44 ` [ 10/49] ARM: OMAP2+: OPP: Fix to ensure check of right oppdef after bad one Greg Kroah-Hartman
2012-08-07 22:44 ` [ 11/49] ALSA: hda - Add support for Realtek ALC282 Greg Kroah-Hartman
2012-08-07 22:44 ` [ 12/49] usbdevfs: Correct amount of data copied to user in processcompl_compat Greg Kroah-Hartman
2012-08-07 22:44 ` [ 13/49] usb: gadget: Fix g_ether interface link status Greg Kroah-Hartman
2012-08-07 22:44 ` [ 14/49] locks: fix checking of fcntl_setlease argument Greg Kroah-Hartman
2012-08-07 22:44 ` [ 15/49] ftrace: Disable function tracing during suspend/resume and hibernation, again Greg Kroah-Hartman
2012-08-07 22:44 ` [ 16/49] stable: update references to older 2.6 versions for 3.x Greg Kroah-Hartman
2012-08-07 22:44 ` [ 17/49] workqueue: perform cpu down operations from low priority cpu_notifier() Greg Kroah-Hartman
2012-08-07 22:44 ` Greg Kroah-Hartman [this message]
2012-08-07 22:44 ` [ 19/49] Btrfs: call the ordered free operation without any locks held Greg Kroah-Hartman
2012-08-07 22:44 ` [ 20/49] drm/radeon: Try harder to avoid HW cursor ending on a multiple of 128 columns Greg Kroah-Hartman
2012-08-07 22:44 ` [ 21/49] drm/radeon: fix non revealent error message Greg Kroah-Hartman
2012-08-07 22:44 ` [ 22/49] drm/radeon: fix hotplug of DP to DVI|HDMI passive adapters (v2) Greg Kroah-Hartman
2012-08-07 22:44 ` [ 23/49] drm/radeon: on hotplug force link training to happen (v2) Greg Kroah-Hartman
2012-08-07 22:44 ` [ 24/49] nfsd4: our filesystems are normally case sensitive Greg Kroah-Hartman
2012-08-07 22:44 ` [ 25/49] nfs: skip commit in releasepage if were freeing memory for fs-related reasons Greg Kroah-Hartman
2012-08-07 22:44 ` [ 26/49] ext4: pass a char * to ext4_count_free() instead of a buffer_head ptr Greg Kroah-Hartman
2012-08-07 22:44 ` [ 27/49] ext4: dont let i_reserved_meta_blocks go negative Greg Kroah-Hartman
2012-08-07 22:44 ` [ 28/49] bnx2: Fix bug in bnx2_free_tx_skbs() Greg Kroah-Hartman
2012-08-07 22:44 ` [ 29/49] sch_sfb: Fix missing NULL check Greg Kroah-Hartman
2012-08-07 22:44 ` [ 30/49] sctp: Fix list corruption resulting from freeing an association on a list Greg Kroah-Hartman
2012-08-07 22:44 ` [ 31/49] caif: Fix access to freed pernet memory Greg Kroah-Hartman
2012-08-07 22:44 ` [ 32/49] cipso: dont follow a NULL pointer when setsockopt() is called Greg Kroah-Hartman
2012-08-07 22:44 ` [ 33/49] caif: fix NULL pointer check Greg Kroah-Hartman
2012-08-07 22:44 ` [ 34/49] wanmain: comparing array with NULL Greg Kroah-Hartman
2012-08-07 22:44 ` [ 35/49] tcp: Add TCP_USER_TIMEOUT negative value check Greg Kroah-Hartman
2012-08-07 22:44 ` [ 36/49] USB: kaweth.c: use GFP_ATOMIC under spin_lock Greg Kroah-Hartman
2012-08-07 22:44 ` [ 37/49] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI handling Greg Kroah-Hartman
2012-08-07 22:44 ` [ 38/49] tcp: perform DMA to userspace only if there is a task waiting for it Greg Kroah-Hartman
2012-08-07 22:44 ` [ 39/49] net/tun: fix ioctl() based info leaks Greg Kroah-Hartman
2012-08-07 22:44 ` [ 40/49] USB: echi-dbgp: increase the controller wait time to come out of halt Greg Kroah-Hartman
2012-08-07 22:44 ` [ 41/49] ALSA: snd-usb: fix clock source validity index Greg Kroah-Hartman
2012-08-07 22:45 ` [ 42/49] ALSA: mpu401: Fix missing initialization of irq field Greg Kroah-Hartman
2012-08-07 22:45 ` [ 43/49] ASoC: wm8962: Allow VMID time to fully ramp Greg Kroah-Hartman
2012-08-07 22:45 ` [ 44/49] ASoC: wm8994: Ensure there are enough BCLKs for four channels Greg Kroah-Hartman
2012-08-07 22:45 ` [ 45/49] m68k: Make sys_atomic_cmpxchg_32 work on classic m68k Greg Kroah-Hartman
2012-08-07 22:45 ` [ 46/49] m68k: Correct the Atari ALLOWINT definition Greg Kroah-Hartman
2012-08-07 22:45 ` [ 47/49] futex: Test for pi_mutex on fault in futex_wait_requeue_pi() Greg Kroah-Hartman
2012-08-07 22:45 ` [ 48/49] futex: Fix bug in WARN_ON for NULL q.pi_state Greg Kroah-Hartman
2012-08-07 22:45 ` [ 49/49] futex: Forbid uaddr == uaddr2 in futex_wait_requeue_pi() Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120807222028.519296642@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tianyu.lan@intel.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).