From patchwork Fri Aug 11 12:55:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vasilyev X-Patchwork-Id: 800541 X-Patchwork-Delegate: boris.brezillon@free-electrons.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PxYx2ikU"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xTQ3R5ggbz9ryk for ; Fri, 11 Aug 2017 22:55:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=s9Xd82WusF8xyB7S3PbH1Zb5rsiOcoUrYJokvJJjssw=; b=PxY x2ikUOtEQgIFoq1ti3URu+F4axi8KqwUI8HooxU/AwPGb24m+Oz6b0sbf8mw8e6ayQ7MZOb1uJO5k GsT9k5zNkl3fbUCfovTdZQhXLOiw17n+WUmUflcjurzcAEgzkdEX8YzsbQhve9f/FC71i8Q7k3DqP hm3iDjjz7HQGqrpB8EgZ+zj1lnKXU53wtNEV4NwN3suNqKkxThZ2xeMfv5j3Tn/+jhXq1A550PuNq kW8B6nbR5Y1XvbAKDAHP6zb0siH1149cyTbCF46b0+lehihxZFTwsw2/XgpXL9FWSnllKnxmdILlv HG5I9RCuTCFSvPtgci2D6ZJ7lArArSQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dg9TZ-00043J-DT; Fri, 11 Aug 2017 12:55:41 +0000 Received: from bran.ispras.ru ([83.149.199.196] helo=smtp.ispras.ru) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dg9TV-0003ul-8X for linux-mtd@lists.infradead.org; Fri, 11 Aug 2017 12:55:39 +0000 Received: from myklebust.intra.ispras.ru (unknown [10.10.2.207]) by smtp.ispras.ru (Postfix) with ESMTP id 610125FB23; Fri, 11 Aug 2017 15:55:11 +0300 (MSK) From: Anton Vasilyev To: David Woodhouse 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170811_055537_554983_9B90ED22 X-CRM114-Status: UNSURE ( 8.15 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ldv-project@linuxtesting.org, Boris Brezillon , Richard Weinberger , linux-kernel@vger.kernel.org, Marek Vasut , linux-mtd@lists.infradead.org, Cyrille Pitchen , Anton Vasilyev , Brian Norris MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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)