diff mbox

usb: gadget: s3c-hsotg: Fix invalid free of devm_ allocated data

Message ID 1353572716-21285-1-git-send-email-tushar.behera@linaro.org
State Accepted
Commit 69f5165ebef1d90bd58e9ce5db018218ea4d089c
Headers show

Commit Message

Tushar Behera Nov. 22, 2012, 8:25 a.m. UTC
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 <tushar.behera@linaro.org>
---
 drivers/usb/gadget/s3c-hsotg.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
diff mbox

Patch

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);
 }
 
 /**