From patchwork Thu Nov 22 04:43:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13060 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 C1BEE23DFE for ; Thu, 22 Nov 2012 04:49:21 +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 525F1A189AB for ; Thu, 22 Nov 2012 04:49:21 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so77009ieb.11 for ; Wed, 21 Nov 2012 20:49:20 -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=1Sws1tUQaL1SoUG8u1ya+l15Q4TcOjrUzCW824j/qww=; b=m4iUvjFiA0Z4rRuxCMrPNR9xgLj6QDT5cnS/3OHJGX06Y7r4d9gj/F5LR99FEtVmq1 DoF1/CgHp7o5ClqVqDxsKQtqk8aQDsUHLtp1l/wLdMisIg6Otn89u/JexvNSgXGo96O8 K/J2jMsS3CjdjV1qKep8BjW8e8PWllz/J0GmiXIP54madBTtN53dYuFlRwlho1L0jBqY VF21YkN0w0IcCLhMay/Sp9glla8zpMHcBnSGkv5M8WEnmlaUPO1oVORznvQlNptqzEez f5osRB+SILGDSsq4j84NlxobxXc0girIF1cuCYKSrax+hxeMMOcOguYIirkjB06tbrUk 9N7w== Received: by 10.50.213.69 with SMTP id nq5mr1815496igc.70.1353559760731; Wed, 21 Nov 2012 20:49:20 -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 n20csp151500igt; Wed, 21 Nov 2012 20:49:20 -0800 (PST) Received: by 10.66.81.138 with SMTP id a10mr23751302pay.53.1353559759894; Wed, 21 Nov 2012 20:49:19 -0800 (PST) Received: from mail-da0-f42.google.com (mail-da0-f42.google.com [209.85.210.42]) by mx.google.com with ESMTPS id yk3si3436712pbc.279.2012.11.21.20.49.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:49:19 -0800 (PST) Received-SPF: neutral (google.com: 209.85.210.42 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.210.42; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.42 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-da0-f42.google.com with SMTP id z17so3396632dal.29 for ; Wed, 21 Nov 2012 20:49:18 -0800 (PST) Received: by 10.66.76.98 with SMTP id j2mr23768423paw.65.1353559758855; Wed, 21 Nov 2012 20:49:18 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id uh10sm1378805pbc.35.2012.11.21.20.49.15 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Nov 2012 20:49:17 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-watchdog@vger.kernel.org Cc: wim@iguana.be, patches@linaro.org, Anthony.Olech@diasemi.com Subject: [PATCH] watchdog: da9052: Fix invalid free of devm_ allocated data Date: Thu, 22 Nov 2012 10:13:04 +0530 Message-Id: <1353559384-26570-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnLaP8JzqIVmzIu2rnFWneiKM4ZcfDIS0Gxnk1EsReD5iwCJ1TEX41yeqJLNiTEhuw8Zqp4 It is not required to free devm_ allocated data. Since kref_put needs a valid release function, da9052_wdt_release_resources() is not deleted. Fixes following warning. drivers/watchdog/da9052_wdt.c:59:1-6: WARNING: invalid free of devm_ allocated data Signed-off-by: Tushar Behera --- drivers/watchdog/da9052_wdt.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/watchdog/da9052_wdt.c b/drivers/watchdog/da9052_wdt.c index f7abbae..20071de 100644 --- a/drivers/watchdog/da9052_wdt.c +++ b/drivers/watchdog/da9052_wdt.c @@ -53,10 +53,6 @@ static const struct { static void da9052_wdt_release_resources(struct kref *r) { - struct da9052_wdt_data *driver_data = - container_of(r, struct da9052_wdt_data, kref); - - kfree(driver_data); } static int da9052_wdt_set_timeout(struct watchdog_device *wdt_dev,