From patchwork Fri Nov 23 12:18:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 1795271 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 96F343FC64 for ; Fri, 23 Nov 2012 12:27:53 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TbsJl-0004dW-PB; Fri, 23 Nov 2012 12:25:14 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TbsJe-0004bG-34 for linux-arm-kernel@lists.infradead.org; Fri, 23 Nov 2012 12:25:10 +0000 Received: by mail-pb0-f49.google.com with SMTP id un15so5949068pbc.36 for ; Fri, 23 Nov 2012 04:25:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=9q/C6GR3gOdsd0VdPm/j0WjCM74OTqJdexlJPq5opQc=; b=Urinagwjs8QzSj6wSLiIuWqdYhp7hK7pKYbgbjJNFRxZ0Eupp7mrqngzN6V94f7/Vx GLm0huWLFC8tjqo72/ooc+0W6Zqjm+kBqYO4rpIZc9MYrXjxiDGOMdxZpTgQfdkErPfx IosdOuk6rmuRSlDWMq3h28weizeV9NtbOkGuhdLFUy5CxCbB4qXTcSj3zubDyv+1wKxT QL+X3tem1yRrYHtaWt3fAmhHwjpVzsj7o3K1k/nnDEySP4mjjb43z/XKNXCoe9tJLLtx CgFGZfyrUZmXAV6W3c2/BbcQw/QZQYqPbxqJECP95PfGe8rRO/R06EK1PV9plFQlIHak W25Q== Received: by 10.66.73.65 with SMTP id j1mr9892380pav.68.1353673502618; Fri, 23 Nov 2012 04:25:02 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id j4sm3639910pax.31.2012.11.23.04.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:25:01 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] mfd: ab8500-core: Fix invalid free of devm_ allocated data Date: Fri, 23 Nov 2012 17:48:43 +0530 Message-Id: <1353673123-32340-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQm7yrMA+F262duUh38460p7T6mWrDi95NECwnNGcApEEUAQnuYJBvSGY5lCvYlm+0ipJDaP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121123_072506_266249_E57354A6 X-CRM114-Status: UNSURE ( 9.75 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linus.walleij@linaro.org, patches@linaro.org, sameo@linux.intel.com, srinidhi.kasagar@stericsson.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The objects allocated by devm_* APIs are managed by devres and are freed when the device is detached. Hence there is no need to remove them explicitly in remove function. Signed-off-by: Tushar Behera Acked-by: Linus Walleij --- drivers/mfd/ab8500-core.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 148d2ee..af7a6ba 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1428,11 +1428,6 @@ static int __devexit ab8500_remove(struct platform_device *pdev) sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group); mfd_remove_devices(ab8500->dev); - free_irq(ab8500->irq, ab8500); - - kfree(ab8500->oldmask); - kfree(ab8500->mask); - kfree(ab8500); return 0; }