Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753135AbdHKMzO (ORCPT ); Fri, 11 Aug 2017 08:55:14 -0400 Received: from bran.ispras.ru ([83.149.199.196]:13827 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752978AbdHKMzN (ORCPT ); Fri, 11 Aug 2017 08:55:13 -0400 From: Anton Vasilyev To: David Woodhouse Cc: Anton Vasilyev , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH] mtd: plat-ram: use release_mem_region instead of release_resource Date: Fri, 11 Aug 2017 15:55:03 +0300 Message-Id: <1502456103-1576-1-git-send-email-vasilyev@ispras.ru> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1052 Lines: 35 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 --- drivers/mtd/maps/plat-ram.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/maps/plat-ram.c b/drivers/mtd/maps/plat-ram.c index 5157289..baaf146 100644 --- a/drivers/mtd/maps/plat-ram.c +++ b/drivers/mtd/maps/plat-ram.c @@ -82,6 +82,7 @@ static inline void platram_setrw(struct platram_info *info, int to) static int platram_remove(struct platform_device *pdev) { struct platram_info *info = to_platram_info(pdev); + resource_size_t res_size; dev_dbg(&pdev->dev, "removing device\n"); @@ -100,8 +101,8 @@ static int platram_remove(struct platform_device *pdev) /* release resources */ if (info->area) { - release_resource(info->area); - kfree(info->area); + res_size = resource_size(info->area) + release_mem_region(info->area->start, res_size); } if (info->map.virt != NULL) -- 2.7.4