diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-04-18 12:57:15 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-04-19 11:11:56 +0300 |
commit | 097aa1975e9a5b189d4c6fbc95c0f97e2c49c01e (patch) | |
tree | a19b8dcb46d4fb5b3560b60ba34dfd9cce902831 /drivers/usb/gadget | |
parent | f78bbcae86e676fad9e6c6bb6cd9d9868ba23696 (diff) | |
download | op-kernel-dev-097aa1975e9a5b189d4c6fbc95c0f97e2c49c01e.zip op-kernel-dev-097aa1975e9a5b189d4c6fbc95c0f97e2c49c01e.tar.gz |
usb: gadget: pch_udc: don't free devm allocated memory
Coccinelle caught this instance of us kfree()ing
devm-allocated memory. The solution is just to not
do anything in our gadget_release.
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc/pch_udc.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/gadget/udc/pch_udc.c b/drivers/usb/gadget/udc/pch_udc.c index b2b70d4..ebc51ec 100644 --- a/drivers/usb/gadget/udc/pch_udc.c +++ b/drivers/usb/gadget/udc/pch_udc.c @@ -2835,17 +2835,6 @@ static void pch_udc_setup_ep0(struct pch_udc_dev *dev) } /** - * gadget_release() - Free the gadget driver private data - * @pdev reference to struct pci_dev - */ -static void gadget_release(struct device *pdev) -{ - struct pch_udc_dev *dev = dev_get_drvdata(pdev); - - kfree(dev); -} - -/** * pch_udc_pcd_reinit() - This API initializes the endpoint structures * @dev: Reference to the driver structure */ @@ -3151,8 +3140,7 @@ static int pch_udc_probe(struct pci_dev *pdev, /* Put the device in disconnected state till a driver is bound */ pch_udc_set_disconnect(dev); - retval = usb_add_gadget_udc_release(&pdev->dev, &dev->gadget, - gadget_release); + retval = usb_add_gadget_udc(&pdev->dev, &dev->gadget); if (retval) goto finished; return 0; |