Re: [PATCH] PCI/P2PDMA: Fix freeing dev_pagemap on error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Oct 12, 2018 at 09:58:14AM -0600, Logan Gunthorpe wrote:
> On 2018-10-12 9:52 a.m., Keith Busch wrote:
> > The devres_free() API is only to be used after the resource has been
> > unlinked from the device tracking it. Calling this functino directly will
> > hit a kernel BUG_ON. This patch fixes this to use the managed resource
> > release function, devm_kfree().
> > 
> > Fixes: 1380472e7b855 ("PCI/P2PDMA: Support peer-to-peer memory")
> > Cc: Logan Gunthorpe <logang@xxxxxxxxxxxx>
> > Signed-off-by: Keith Busch <keith.busch@xxxxxxxxx>
> 
> Oops, yes, nice catch! Thanks!

Yeah, I hit the bug after an nvme controller reset. The nvme driver
tries to add its CMB memory a second time, and it's correctly detected
as an error by devm_memremap_pages(), but I'm also thinking nvme should
have known better too.

Anyway, this patch (its v2, really) is the simple error handling fix,
but there will be a follow up nvme patch to avoid the error in the first
place. :)



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux