Skip to content

Commit

Permalink
usb: gadget: s3c-hsotg: Fix invalid free of devm_ allocated data
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Tushar Behera authored and Felipe Balbi committed Dec 13, 2012
1 parent c1a96eb commit 69f5165
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/usb/gadget/s3c-hsotg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3477,12 +3477,11 @@ static void 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);
}

/**
Expand Down

0 comments on commit 69f5165

Please sign in to comment.