提交 2a334cfa 编写于 作者: A Alexey Khoroshilov 提交者: Felipe Balbi

usb: gadget: goku_udc: fix memory leak in goku_probe()

Memory allocated for goku_udc device is not deallocated at error
paths in goku_probe(), because gadget_release() destructor
is not registered yet.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: NAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: NFelipe Balbi <felipe.balbi@linux.intel.com>
上级 01da5198
......@@ -1838,6 +1838,8 @@ static int goku_probe(struct pci_dev *pdev, const struct pci_device_id *id)
err:
if (dev)
goku_remove (pdev);
/* gadget_release is not registered yet, kfree explicitly */
kfree(dev);
return retval;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册