linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Moore, Robert" <robert.moore@intel.com>
To: "Moore, Robert" <robert.moore@intel.com>,
	Zhenhua <lizhenhuajiyang@163.com>,
	"devel@acpica.org" <devel@acpica.org>,
	"Zheng, Lv" <lv.zheng@intel.com>,
	"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
	"lenb@kernel.org" <lenb@kernel.org>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Schmauss, Erik" <erik.schmauss@intel.com>,
	"Box, David E" <david.e.box@intel.com>
Subject: RE: [PATCH 1/1] ACPI: NULL pointer checking
Date: Thu, 7 Sep 2017 19:26:56 +0000	[thread overview]
Message-ID: <94F2FBAB4432B54E8AACC7DFDE6C92E37E60C211@ORSMSX110.amr.corp.intel.com> (raw)
In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E37E60BA3F@ORSMSX110.amr.corp.intel.com>



> -----Original Message-----
> From: Devel [mailto:devel-bounces@acpica.org] On Behalf Of Moore, Robert
> Sent: Wednesday, September 6, 2017 9:43 AM
> To: Zhenhua <lizhenhuajiyang@163.com>; devel@acpica.org; Zheng, Lv
> <lv.zheng@intel.com>; Wysocki, Rafael J <rafael.j.wysocki@intel.com>;
> lenb@kernel.org; linux-acpi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: Re: [Devel] [PATCH 1/1] ACPI: NULL pointer checking
> 
> 
> 
> > -----Original Message-----
> > From: Zhenhua [mailto:lizhenhuajiyang@163.com]
> > Sent: Wednesday, September 6, 2017 6:35 AM
> > To: devel@acpica.org; Moore, Robert <robert.moore@intel.com>; Zheng,
> > Lv <lv.zheng@intel.com>; Wysocki, Rafael J
> > <rafael.j.wysocki@intel.com>; lenb@kernel.org;
> > linux-acpi@vger.kernel.org; linux- kernel@vger.kernel.org
> > Cc: Zhenhua <lizhenhuajiyang@163.com>
> > Subject: [PATCH 1/1] ACPI: NULL pointer checking
> >
> > These two pointers should be checked, for some broken devices they may
> > cause system crash.
> >
> > Signed-off-by: Zhenhua <lizhenhuajiyang@163.com>
> > ---
> >  drivers/acpi/acpica/nsaccess.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/acpi/acpica/nsaccess.c
> > b/drivers/acpi/acpica/nsaccess.c index f2733f51ca8d..151abb0ef4d5
> > 100644
> > --- a/drivers/acpi/acpica/nsaccess.c
> > +++ b/drivers/acpi/acpica/nsaccess.c
> > @@ -338,7 +338,7 @@ acpi_ns_lookup(union acpi_generic_state
> *scope_info,
> >  			return_ACPI_STATUS(AE_AML_INTERNAL);
> >  		}
> >
> > -		if (!(flags & ACPI_NS_PREFIX_IS_SCOPE)) {
> > +		if ((!prefix_node) && (!(flags & ACPI_NS_PREFIX_IS_SCOPE))) {
> [Moore, Robert]
> 
> Is there an actual case where the original code failed?
> 
> 
[Moore, Robert] 

Prefix_node is guaranteed to be valid at this point in the code.


> 
> >  			/*
> >  			 * This node might not be a actual "scope" node (such as
> a
> >  			 * Device/Method, etc.)  It could be a Package or other
> object @@
> > -369,7 +369,7 @@ acpi_ns_lookup(union acpi_generic_state *scope_info,
> >  		ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
> >  				  "Null Pathname (Zero segments), Flags=%X\n",
> >  				  flags));
> > -	} else {
> > +	} else if (path) {
[Moore, Robert] 

Likewise, "path" is guaranteed to be valid at this point.


> >  		/*
> >  		 * Name pointer is valid (and must be in internal name
> > format)
> >  		 *
> > --
> > 2.14.1
> >
> 
> _______________________________________________
> Devel mailing list
> Devel@acpica.org
> https://lists.acpica.org/mailman/listinfo/devel

      reply	other threads:[~2017-09-07 19:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-06 13:35 [PATCH 1/1] ACPI: NULL pointer checking Zhenhua
2017-09-06 16:42 ` Moore, Robert
2017-09-07 19:26   ` Moore, Robert [this message]

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=94F2FBAB4432B54E8AACC7DFDE6C92E37E60C211@ORSMSX110.amr.corp.intel.com \
    --to=robert.moore@intel.com \
    --cc=david.e.box@intel.com \
    --cc=devel@acpica.org \
    --cc=erik.schmauss@intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizhenhuajiyang@163.com \
    --cc=lv.zheng@intel.com \
    --cc=rafael.j.wysocki@intel.com \
    /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).