]> git.baikalelectronics.ru Git - kernel.git/commit
usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_...
authorAndrey Strachuk <strochuk@ispras.ru>
Mon, 18 Jul 2022 16:00:52 +0000 (19:00 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:58 +0000 (14:23 +0200)
commit585b29b99ed63a09d1242e10fa15a4d088691c92
treec7876a827c44ef285d2c4948e11da448e9ffa471
parente317798b8c510567acf4c135ed90e2d4cfe348af
usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_gadget_ep_enable()

[ Upstream commit 6ba7eb0fda928cc4d267fa9ce7061450a420e216 ]

If 'ep' is NULL, result of ep_to_cdns3_ep(ep) is invalid pointer
and its dereference with priv_ep->cdns3_dev may cause panic.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 890954bdc8d0 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Acked-by: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Andrey Strachuk <strochuk@ispras.ru>
Link: https://lore.kernel.org/r/20220718160052.4188-1-strochuk@ispras.ru
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/cdns3/cdns3-gadget.c