aboutsummaryrefslogtreecommitdiffstats
path: root/lib/genalloc.c
diff options
context:
space:
mode:
authorDan Williams <[email protected]>2019-06-13 22:56:24 +0000
committerLinus Torvalds <[email protected]>2019-06-14 03:34:56 +0000
commite615a191216e3fb4e9c0d239007f2b0cd48f28bf (patch)
tree0af64500c4f575848193609912b68744c408882f /lib/genalloc.c
parentmm/devm_memremap_pages: introduce devm_memunmap_pages (diff)
downloadkernel-e615a191216e3fb4e9c0d239007f2b0cd48f28bf.tar.gz
kernel-e615a191216e3fb4e9c0d239007f2b0cd48f28bf.zip
PCI/P2PDMA: fix the gen_pool_add_virt() failure path
The pci_p2pdma_add_resource() implementation immediately frees the pgmap if gen_pool_add_virt() fails. However, that means that when @dev triggers a devres release devm_memremap_pages_release() will crash trying to access the freed @pgmap. Use the new devm_memunmap_pages() to manually free the mapping in the error path. Link: http://lkml.kernel.org/r/155727337603.292046.13101332703665246702.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <[email protected]> Fixes: 52916982af48 ("PCI/P2PDMA: Support peer-to-peer memory") Reviewed-by: Ira Weiny <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Reviewed-by: Logan Gunthorpe <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: "Jérôme Glisse" <[email protected]> Cc: "Rafael J. Wysocki" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/genalloc.c')
0 files changed, 0 insertions, 0 deletions