Commit 84b1341f authored by Zhang Qilong's avatar Zhang Qilong Committed by Zheng Zengkai
Browse files

usb: gadget: remove leaked entry from udc driver list

stable inclusion
from stable-5.10.58
commit 822bec5cbb05846b2a647f20c4acb2dec0e01ff0
bugzilla: 176984 https://gitee.com/openeuler/kernel/issues/I4E2P4

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



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

commit fa4a8dcf upstream.

The usb_add_gadget_udc will add a new gadget to the udc class
driver list. Not calling usb_del_gadget_udc in error branch
will result in residual gadget entry in the udc driver list.
We fix it by calling usb_del_gadget_udc to clean it when error
return.

Fixes: 48ba02b2 ("usb: gadget: add udc driver for max3420")
Acked-by: default avatarFelipe Balbi <balbi@kernel.org>
Signed-off-by: default avatarZhang Qilong <zhangqilong3@huawei.com>
Link: https://lore.kernel.org/r/20210727073142.84666-1-zhangqilong3@huawei.com


Cc: stable <stable@vger.kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatarWeilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 9a08a7a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment