All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu>,
	Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: Re: [patch 9/9] acpi: fix NULL bug for HID/UID string
Date: Fri, 14 Aug 2009 09:28:56 +0800	[thread overview]
Message-ID: <1250213336.2987.3.camel@minggr.sh.intel.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0908131724370.8831@sister.anvils>

On Fri, 2009-08-14 at 00:46 +0800, Hugh Dickins wrote:
> On Thu, 13 Aug 2009, Bjorn Helgaas wrote:
> > On Thursday 06 August 2009 05:18:12 pm Hugh Dickins wrote:
> > > It's up to Len to choose, but I thought we preferred...
> > > 
> > > From: Hugh Dickins <hugh.dickins@tiscali.co.uk>
> > > 
> > > acpi_device->pnp.hardware_id and unique_id are now allocated pointers,
> > > replacing the previous arrays.  acpi_device_install_notify_handler()
> > > oopsed on the NULL hid when probing the video device, 
> > 
> > I'm sorry I wasn't aware of the acpi_device_install_notify_handler()
> > issue until just now, since I added the code that oopses (46ec8598fd).
> 
> Sorry for not Cc'ing you: but you can hardly be blamed for
> not foreseeing future changes which might affect your code.
> 
> > 
> > I recently posted patches that removed the dependency on the HID
> > in this path:
> > 
> >   http://marc.info/?l=linux-acpi&m=124907623701270&w=2
> > 
> > I thought Len said they had been applied to acpi-test, but I don't
> > see them there.
> > 
> > But I don't object to Hugh's patch, since it might be useful for other
> > paths.
> 
> My original patch, when I hit the bug, was just to
> acpi_device_install_notify_handler(): I have never seen a
> problem anywhere else, and your patch would deal with that.
> 
> But Lin Ming believes there might be issues elsewhere (I have no idea),
> posting a more general patch; then my patch here was a retort to that.
> 
> What I'm saying is: so far as I know, your patch is more appropriate
> than mine; but probably Lin Ming knows better, and mine needed too.

As below, there are many calls of acpi_device_hid without any check of
NULL hid.
So yes, we need a general patch, as yours.

0 drivers/acpi/button.c                 acpi_button_add                     308 hid = acpi_device_hid(device);
1 drivers/acpi/processor_core.c         acpi_processor_get_info             599 if (!strcmp(acpi_device_hid(device), ACPI_PROCESSOR_OBJECT_HID)) {
2 drivers/acpi/scan.c                   acpi_device_install_notify_handler  378 hid = acpi_device_hid(device);
3 drivers/acpi/scan.c                   acpi_device_remove_notify_handler   402 if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_POWERF))
4 drivers/acpi/scan.c                   acpi_device_remove_notify_handler   405 else if (!strcmp(acpi_device_hid(device), ACPI_BUTTON_HID_SLEEPF))
5 drivers/acpi/video.c                  acpi_video_bus_add                 2248 "%s/video/input0", acpi_device_hid(video->device));
6 drivers/gpu/drm/i915/intel_lvds.c     check_lid_device                    822 if (!strncmp(acpi_device_hid(acpi_dev), "PNP0C0D", 7))
7 drivers/platform/x86/fujitsu-laptop.c acpi_fujitsu_add                    681 "%s/video/input0", acpi_device_hid(device));
8 drivers/platform/x86/fujitsu-laptop.c acpi_fujitsu_hotkey_add             852 "%s/video/input0", acpi_device_hid(device));
9 drivers/pnp/pnpacpi/core.c            pnpacpi_add_device                  162 if (ACPI_FAILURE(status) || !ispnpidacpi(acpi_device_hid(device)) ||
a drivers/pnp/pnpacpi/core.c            pnpacpi_add_device                  166 dev = pnp_alloc_dev(&pnpacpi_protocol, num, acpi_device_hid(device));

Lin Ming

> 
> Hugh


  reply	other threads:[~2009-08-14  1:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 22:57 [patch 9/9] acpi: fix NULL bug for HID/UID string akpm
2009-08-06 23:18 ` Hugh Dickins
2009-08-13 15:55   ` Bjorn Helgaas
2009-08-13 16:46     ` Hugh Dickins
2009-08-14  1:28       ` Lin Ming [this message]
2009-08-14 16:44         ` Bjorn Helgaas
2009-08-14 18:18           ` Hugh Dickins
2009-08-14 20:08             ` Bjorn Helgaas
2009-08-14 20:36               ` Hugh Dickins
2009-08-14 19:53           ` Valdis.Kletnieks
2009-08-14 20:10             ` Bjorn Helgaas
2009-08-15 14:14               ` Bartlomiej Zolnierkiewicz
2009-08-17 17:44                 ` Bjorn Helgaas
2009-09-01  1:41   ` Len Brown

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=1250213336.2987.3.camel@minggr.sh.intel.com \
    --to=ming.m.lin@intel.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=bzolnier@gmail.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.