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>
Wed, 29 Jul 2020 08:19:52 +0000 (10:19 +0200)
commit0b15c8cc14bd1b92e027c9354bf0ab359ffe8e93
tree3893baacefa43479cb12febc1647996504c2be49
parent27d6819fc25ed2c77c04867ad3435fecda11e3be
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