Commit 5e7b3add authored by Andrey Strachuk's avatar Andrey Strachuk Committed by Zheng Zengkai
Browse files

usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(),...

usb: cdns3: change place of 'priv_ep' assignment in cdns3_gadget_ep_dequeue(), cdns3_gadget_ep_enable()

stable inclusion
from stable-v5.10.137
commit 7af83bb516d7aa4f96835288e4aeda21d7aa2a17
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=7af83bb516d7aa4f96835288e4aeda21d7aa2a17



--------------------------------

[ Upstream commit c3ffc9c4 ]

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: 7733f6c3 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Acked-by: default avatarPeter Chen <peter.chen@kernel.org>
Signed-off-by: default avatarAndrey Strachuk <strochuk@ispras.ru>
Link: https://lore.kernel.org/r/20220718160052.4188-1-strochuk@ispras.ru


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: default avatarWei Li <liwei391@huawei.com>
parent 2286e7f6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment