usb: gadget: don't release an existing dev->buf
authorHangyu Hua <hbh25y@gmail.com>
Fri, 31 Dec 2021 17:21:37 +0000 (01:21 +0800)
committerPDO SCM Team <hudsoncm@motorola.com>
Tue, 14 Jun 2022 07:00:26 +0000 (02:00 -0500)
commit402ab9beb5b200642304bd7a762936107282a83a
tree48b4a2c7d35c452e491209b94ed025880bb1f6f9
parent6e3355c5777af5eac4a6e9d7261f5f19d8c72c2d
usb: gadget: don't release an existing dev->buf

commit 89f3594d0de58e8a57d92d497dea9fee3d4b9cda upstream.

dev->buf does not need to be released if it already exists before
executing dev_config.

Mot-CRs-fixed: (CR)
CVE-Fixed: CVE-2022-24958
Bug: 220261709

Change-Id: I0eb72bf758a7909ce31e2aa960ed0583b1632a95
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Link: https://lore.kernel.org/r/20211231172138.7993-2-hbh25y@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Gajjala Chakradhar <gajjalac@motorola.com>
Reviewed-on: https://gerrit.mot.com/2276113
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
drivers/usb/gadget/legacy/inode.c