Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290AbdHOMVy (ORCPT ); Tue, 15 Aug 2017 08:21:54 -0400 Received: from bran.ispras.ru ([83.149.199.196]:18087 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751590AbdHOMVx (ORCPT ); Tue, 15 Aug 2017 08:21:53 -0400 From: Anton Vasilyev To: Boris Brezillon Cc: Anton Vasilyev , David Woodhouse , Brian Norris , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org Subject: [PATCH v1] mtd: plat-ram: use release_mem_region instead of release_resource Date: Tue, 15 Aug 2017 15:21:34 +0300 Message-Id: <1502799694-669-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: 809 Lines: 29 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 --- 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