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: 13155 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id DFF8423FC2 for ; Fri, 23 Nov 2012 12:25:04 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 751DDA184D0 for ; Fri, 23 Nov 2012 12:25:04 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1735483ieb.11 for ; Fri, 23 Nov 2012 04:25:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=9q/C6GR3gOdsd0VdPm/j0WjCM74OTqJdexlJPq5opQc=; b=Adtny7M75QD2V4nPJaYFRKlZkfKcb9UrSRFMi+7LfLPhVkFfJbQMaGW7NAUPBv7RkA ESMvPR8kTVc1DJqF8fIBSVro8uy6OkFrG/cfC21ksoe/DLld+qHQida22NabT9Qx+Cze FxNLMdE2s8RUsR+y8hDgYS5rK0IgjATrSkpYmDkpzXKAXHFAg6u2njwCeQR61D4fauvV /w2RfRmjEpfcvo20lES2oPau7OP0PGUlflBOyIkqx535143Go1qAiZAOX8p6hxH95KeS r3bYjNddRa4KJR1aGJ2hFSeYGScqsb+VfQ9kAXU1oqTvRHIfwCd0203s4Kh/mlFnW2LZ MSYw== Received: by 10.50.213.69 with SMTP id nq5mr5885120igc.70.1353673503945; Fri, 23 Nov 2012 04:25:03 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp344356igt; Fri, 23 Nov 2012 04:25:03 -0800 (PST) Received: by 10.68.241.133 with SMTP id wi5mr13877615pbc.48.1353673502924; Fri, 23 Nov 2012 04:25:02 -0800 (PST) Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by mx.google.com with ESMTPS id f9si7810962paw.179.2012.11.23.04.25.02 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 23 Nov 2012 04:25:02 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.41; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by mail-pb0-f41.google.com with SMTP id xa7so5793366pbc.28 for ; Fri, 23 Nov 2012 04:25:02 -0800 (PST) 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 Cc: sameo@linux.intel.com, linus.walleij@linaro.org, srinidhi.kasagar@stericsson.com, patches@linaro.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: ALoCoQlvJ6eU3xCX1lwppNdPmeRIHjPQplo0Ap8fVSTXAT1o0yRrNxQEGG7bD5tePYXRG/E0dqGa 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; }