diff mbox series

libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning

Message ID 162321342919.2151549.7438715629081965798.stgit@dwillia2-desk3.amr.corp.intel.com (mailing list archive)
State New
Headers show
Series libnvdimm/pmem: Fix pmem_pagemap_cleanup compile warning | expand

Commit Message

Dan Williams June 9, 2021, 4:37 a.m. UTC
The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer
dereference with the queue_to_disk() helper neglected to remove the @q
variable when queue_to_disk() was replaced.

Drop the conversion of @pgmap to its containing 'struct request_queue'
since pgmap->owner supersedes the need to reference @q.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 80b58f4e9f4a ("libnvdimm/pmem: Fix blk_cleanup_disk() usage")
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
---
 drivers/nvdimm/pmem.c |    2 --
 1 file changed, 2 deletions(-)

Comments

Jens Axboe June 9, 2021, 3:10 p.m. UTC | #1
On 6/8/21 10:37 PM, Dan Williams wrote:
> The recent fix to pmem_pagemap_cleanup() to solve a NULL pointer
> dereference with the queue_to_disk() helper neglected to remove the @q
> variable when queue_to_disk() was replaced.
> 
> Drop the conversion of @pgmap to its containing 'struct request_queue'
> since pgmap->owner supersedes the need to reference @q.

I folded this in.
diff mbox series

Patch

diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index fc6b78dd2d24..1e0615b8565e 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -335,8 +335,6 @@  static const struct attribute_group *pmem_attribute_groups[] = {
 
 static void pmem_pagemap_cleanup(struct dev_pagemap *pgmap)
 {
-	struct request_queue *q =
-		container_of(pgmap->ref, struct request_queue, q_usage_counter);
 	struct pmem_device *pmem = pgmap->owner;
 
 	blk_cleanup_disk(pmem->disk);