From: Keith Busch <keith.busch@intel.com>
To: Logan Gunthorpe <logang@deltatee.com>
Cc: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>
Subject: Re: [PATCH] PCI/P2PDMA: Fix freeing dev_pagemap on error
Date: Fri, 12 Oct 2018 10:21:42 -0600 [thread overview]
Message-ID: <20181012162142.GA15490@localhost.localdomain> (raw)
In-Reply-To: <7fa9a510-9197-a07d-958d-8b23e39cc288@deltatee.com>
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@deltatee.com>
> > Signed-off-by: Keith Busch <keith.busch@intel.com>
>
> 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. :)
prev parent reply other threads:[~2018-10-12 16:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-12 15:52 [PATCH] PCI/P2PDMA: Fix freeing dev_pagemap on error Keith Busch
2018-10-12 15:56 ` Keith Busch
2018-10-12 15:58 ` Logan Gunthorpe
2018-10-12 16:21 ` Keith Busch [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=20181012162142.GA15490@localhost.localdomain \
--to=keith.busch@intel.com \
--cc=helgaas@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=logang@deltatee.com \
/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