public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v1] mtd: plat-ram: use release_mem_region instead of release_resource
@ 2017-08-15 12:21 Anton Vasilyev
  2017-08-15 17:13 ` Boris Brezillon
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Vasilyev @ 2017-08-15 12:21 UTC (permalink / raw)
  To: Boris Brezillon
  Cc: Anton Vasilyev, David Woodhouse, Brian Norris, Marek Vasut,
	Richard Weinberger, Cyrille Pitchen, linux-mtd, linux-kernel,
	ldv-project

Use api pair of request_mem_region and release_mem_region
instead of release_resource.

Found by Linux Driver Verification project (linuxtesting.

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
---
v1: Fix commit based on Boris Brezillon review
---
 drivers/mtd/maps/plat-ram.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c
index 5157289..90bc87f 100644
--- a/drivers/mtd/maps/plat-ram.c
+++ b/drivers/mtd/maps/plat-ram.c
@@ -100,8 +100,8 @@ static int platram_remove(struct platform_device *pdev)
 	/* release resources */
 
 	if (info->area) {
-		release_resource(info->area);
-		kfree(info->area);
+		release_mem_region(info->area->start,
+				resource_size(info->area));
 	}
 
 	if (info->map.virt != NULL)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-08-15 17:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-15 12:21 [PATCH v1] mtd: plat-ram: use release_mem_region instead of release_resource Anton Vasilyev
2017-08-15 17:13 ` Boris Brezillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox