usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i]
authorAnton Vasilyev <vasilyev@ispras.ru>
Tue, 7 Aug 2018 11:44:48 +0000 (14:44 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Oct 2018 06:53:20 +0000 (08:53 +0200)
commit185261d7dd77cea1ee21645c343887f320bbb1e1
tree673000733143c3a43b915ba11d0d655dccfccfc5
parent86d2b2f2eb218891b37a7ae4d3edcd504b4d5304
usb: gadget: fotg210-udc: Fix memory leak of fotg210->ep[i]

[ Upstream commit c37bd52836296ecc9a0fc8060b819089aebdbcde ]

There is no deallocation of fotg210->ep[i] elements, allocated at
fotg210_udc_probe.

The patch adds deallocation of fotg210->ep array elements and simplifies
error path of fotg210_udc_probe().

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/fotg210-udc.c