usb: cdns3: Do not access memory after free
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Wed, 13 Aug 2025 16:30:12 +0000 (17:30 +0100)
committerMarek Vasut <marek.vasut+usb@mailbox.org>
Fri, 29 Aug 2025 11:12:41 +0000 (13:12 +0200)
commitae2cd1b52d4ded22ac2359964c5682b5a5c1cc28
treea124024b798820a20d9ae66d04971971c0ff8f65
parent3dc5e9a0108bb114175b6362f9cb22367402f624
usb: cdns3: Do not access memory after free

The call to cdns3_gadget_ep_free_request will free priv_req so do the
call to list_del_init which accesses the memory pointed to by priv_req
before the free.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Siddharth Vadapalli <s-vadapalli@ti.com>
drivers/usb/cdns3/gadget.c