mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
libnvdimm, pmem: Fix badblocks population for 'raw' namespaces
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: e8d5134833 ("memremap: change devm_memremap_pages interface...")
Cc: <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Reported-by: Jacek Zloch <[email protected]>
Reported-by: Krzysztof Rusocki <[email protected]>
Reviewed-by: Vishal Verma <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
This commit is contained in:
parent
55781b6693
commit
91ed7ac444
1 changed files with 3 additions and 1 deletions
|
|
@ -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));
|
||||
}
|
||||
|
||||
/*
|
||||
* At release time the queue must be frozen before
|
||||
|
|
|
|||
Loading…
Reference in a new issue