[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cdba20f7ba8186862f8b3596b0766be240297162.camel@intel.com>
Date: Fri, 5 Oct 2018 00:19:55 +0000
From: "Verma, Vishal L" <vishal.l.verma@...el.com>
To: "Williams, Dan J" <dan.j.williams@...el.com>,
"linux-nvdimm@...ts.01.org" <linux-nvdimm@...ts.01.org>
CC: "hch@....de" <hch@....de>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"Zloch, Jacek" <jacek.zloch@...el.com>,
"Rusocki, Krzysztof" <krzysztof.rusocki@...el.com>,
"stable@...r.kernel.org" <stable@...r.kernel.org>
Subject: Re: [PATCH] libnvdimm, pmem: Fix badblocks population for 'raw'
namespaces
On Thu, 2018-10-04 at 16:56 -0700, Dan Williams wrote:
> The driver is only initializing bb_res in the devm_memremap_pages()
> paths, but the raw namespace case is passing an uninitialized bb_res
> to
> nvdimm_badblocks_populate().
>
> Fixes: e8d513483300 ("memremap: change devm_memremap_pages
> interface...")
> Cc: <stable@...r.kernel.org>
> Cc: Christoph Hellwig <hch@....de>
> Reported-by: Jacek Zloch <jacek.zloch@...el.com>
> Reported-by: Krzysztof Rusocki <krzysztof.rusocki@...el.com>
> Signed-off-by: Dan Williams <dan.j.williams@...el.com>
> ---
> drivers/nvdimm/pmem.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index 6071e2942053..2082ae01b9c8 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -421,9 +421,11 @@ static int pmem_attach_disk(struct device *dev,
> addr = devm_memremap_pages(dev, &pmem->pgmap);
> pmem->pfn_flags |= PFN_MAP;
> memcpy(&bb_res, &pmem->pgmap.res, sizeof(bb_res));
> - } else
> + } else {
> addr = devm_memremap(dev, pmem->phys_addr,
> pmem->size, ARCH_MEMREMAP_PMEM);
> + memcpy(&bb_res, &nsio->res, sizeof(bb_res));
> + }
Good find!
Reviewed-by: Vishal Verma <vishal.l.verma@...el.com>
Powered by blists - more mailing lists