Commit 98cbe1e9 authored by Dan Carpenter's avatar Dan Carpenter Committed by sanglipeng
Browse files

usb: gadget: udc: fix NULL dereference in remove()

stable inclusion
from stable-v5.10.186
commit eaf1fa94520696ee7002613cec0b85afdd4d076a
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8J4KH

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



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

[ Upstream commit 016da9c6 ]

The "udc" pointer was never set in the probe() function so it will
lead to a NULL dereference in udc_pci_remove() when we do:

	usb_del_gadget_udc(&udc->gadget);

Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/ZG+A/dNpFWAlCChk@kili


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 41877ce4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment