]> 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, 27 Jul 2022 12:38:13 +0000 (14:38 +0200)
commit6ba7eb0fda928cc4d267fa9ce7061450a420e216
treee95f7bd26c271141dde8611e54382904da557bca
parentb5915679aa4dee8acdccbb820eef5676a088d0a9
usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_gadget_ep_enable()

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>
drivers/usb/cdns3/cdns3-gadget.c