linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Kani, Toshi" <toshi.kani@hpe.com>
To: "dan.j.williams@intel.com" <dan.j.williams@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>,
	"rjw@rjwysocki.net" <rjw@rjwysocki.net>,
	"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>
Subject: Re: [PATCH] acpi, nfit: fix register dimm error handling
Date: Fri, 2 Feb 2018 20:38:41 +0000	[thread overview]
Message-ID: <1517606653.16384.106.camel@hpe.com> (raw)
In-Reply-To: <CAPcyv4jPNxSKxb-kzaw8njhDHGUs7DOPASS_GBXbPGOFP4RN=g@mail.gmail.com>

On Fri, 2018-02-02 at 12:31 -0800, Dan Williams wrote:
> On Fri, Feb 2, 2018 at 1:00 PM, Toshi Kani <toshi.kani@hpe.com> wrote:
> > A NULL pointer reference kernel bug was observed when
> > acpi_nfit_add_dimm() called in acpi_nfit_register_dimms()
> > failed. This error path does not set nfit_mem->nvdimm, but
> > the 2nd list_for_each_entry() loop in the function assumes
> > it's always set. Add a check to nfit_mem->nvdimm.
> > 
> > Signed-off-by: Toshi Kani <toshi.kani@hpe.com>
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
> > ---
> >  drivers/acpi/nfit/core.c |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> > index abeb4df4f22e..b28ce440a06f 100644
> > --- a/drivers/acpi/nfit/core.c
> > +++ b/drivers/acpi/nfit/core.c
> > @@ -1867,6 +1867,9 @@ static int acpi_nfit_register_dimms(struct acpi_nfit_desc *acpi_desc)
> >                 struct kernfs_node *nfit_kernfs;
> > 
> >                 nvdimm = nfit_mem->nvdimm;
> > +               if (!nvdimm)
> > +                       continue;
> > +
> >                 nfit_kernfs = sysfs_get_dirent(nvdimm_kobj(nvdimm)->sd, "nfit");
> >                 if (nfit_kernfs)
> >                         nfit_mem->flags_attr = sysfs_get_dirent(nfit_kernfs,
> 
> Yes, I assume this also needs:
> 
> Cc: <stable@vger.kernel.org>
> Fixes: ba9c8dd3c222 ("acpi, nfit: add dimm device notification support")

Right. Thanks!
-Toshi

      reply	other threads:[~2018-02-02 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-02 21:00 [PATCH] acpi, nfit: fix register dimm error handling Toshi Kani
     [not found] ` <20180202210036.3153-1-toshi.kani-ZPxbGqLxI0U@public.gmane.org>
2018-02-02 20:31   ` Dan Williams
2018-02-02 20:38     ` Kani, Toshi [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=1517606653.16384.106.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=rjw@rjwysocki.net \
    /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).