usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init()
authorEvgeny Novikov <novikov@ispras.ru>
Fri, 26 Jun 2020 13:17:47 +0000 (16:17 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Jul 2020 14:44:03 +0000 (16:44 +0200)
commitf038d105d093c596f390798436c0478bd7479614
tree3aa283717469fcc21c4e0142ca9eec4ed71c4a53
parent9ef026214f70de1ce50559421d54ad9741d14e52
usb: gadget: udc: gr_udc: fix memleak on error handling path in gr_ep_init()

[ Upstream commit c8f8529e2c4141afa2ebb487ad48e8a6ec3e8c99 ]

gr_ep_init() does not assign the allocated request anywhere if allocation
of memory for the buffer fails. This is a memory leak fixed by the given
patch.

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

Signed-off-by: Evgeny Novikov <novikov@ispras.ru>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/gadget/udc/gr_udc.c