From patchwork Thu Nov 22 08:25:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 13066 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 387AE23FC1 for ; Thu, 22 Nov 2012 08:31:37 +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 D9EE1A196D9 for ; Thu, 22 Nov 2012 08:31:36 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so255437ieb.11 for ; Thu, 22 Nov 2012 00:31:36 -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=BucNuAlm8lbdHvdkcJn0OVKz0wsP+603eSaaQJ4ByME=; b=gosKCAgztkyU+sy0KU7skdOE3Fkx1mMVRA663jgkxlmoGEQpzWXWZtsGpZsQdhjY/v ShBZfyNe1Iz+dlLrGZy146QgwvcpIjaPwq3u9/xnrw8YfRBy2pEgZTldxtrw3vVTsFfq Gl/fPXLaAZAP8ezypkesB48NN9XLKldM9e01oVgiSRs8ywD/peM2oG5CcFh51ddS9yL8 wgVnTikV002GG4VLYko9S5HqmIbWejz/K+J3UKWmZgQKUb0H71ydRsDb8NbMWs/E20Ky cIQoT7JJ6M4HnP79/F2SAiKeth1x6vJWFf9nIwgafCzasmBefdIXI86y91g13gOsAvaE NLeg== Received: by 10.43.46.2 with SMTP id um2mr19649326icb.18.1353573096340; Thu, 22 Nov 2012 00:31:36 -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 n20csp174864igt; Thu, 22 Nov 2012 00:31:35 -0800 (PST) Received: by 10.66.77.196 with SMTP id u4mr24819748paw.84.1353573095381; Thu, 22 Nov 2012 00:31:35 -0800 (PST) Received: from mail-pb0-f45.google.com (mail-pb0-f45.google.com [209.85.160.45]) by mx.google.com with ESMTPS id i6si3567038pay.333.2012.11.22.00.31.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 00:31:35 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.45 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.45; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.45 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-f45.google.com with SMTP id mc8so5812033pbc.32 for ; Thu, 22 Nov 2012 00:31:35 -0800 (PST) Received: by 10.68.245.169 with SMTP id xp9mr2586420pbc.142.1353573095068; Thu, 22 Nov 2012 00:31:35 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qt3sm1706458pbb.32.2012.11.22.00.31.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 00:31:34 -0800 (PST) From: Tushar Behera To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: balbi@ti.com, patches@linaro.org Subject: [PATCH] usb: gadget: s3c-hsotg: Fix invalid free of devm_ allocated data Date: Thu, 22 Nov 2012 13:55:16 +0530 Message-Id: <1353572716-21285-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnptGZS/eLwKwKj2HYa2HffTdM9kialse3HpGav7iDm+EfDyuycm96kMhUdwELBzitJyfsS Since hsotg object is allocated using devm_kzalloc() API, there is no need to free this explicitly. But we need to keep the release API to prevent warnings. Signed-off-by: Tushar Behera --- drivers/usb/gadget/s3c-hsotg.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 6f696ee..093a56a 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c @@ -3477,12 +3477,11 @@ static void __devexit s3c_hsotg_delete_debug(struct s3c_hsotg *hsotg) /** * s3c_hsotg_release - release callback for hsotg device * @dev: Device to for which release is called + * + * Nothing to do as the resource is allocated using devm_ API. */ static void s3c_hsotg_release(struct device *dev) { - struct s3c_hsotg *hsotg = dev_get_drvdata(dev); - - kfree(hsotg); } /**