Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1000446ybh; Wed, 15 Jul 2020 23:42:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHnCto51HHmKp7GuYs6QVoKkPFrQj5FkYu1VwamhGKkVOJJKxU3a4W7NIT3z6ZFufPlyzg X-Received: by 2002:adf:f14c:: with SMTP id y12mr3447275wro.30.1594881746235; Wed, 15 Jul 2020 23:42:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594881746; cv=none; d=google.com; s=arc-20160816; b=HyCad5VaR8KfSBX5FKEFBM4Qt3c4VsZZg0O+CkMwdNZdprVK0p4aiK1IB4esx2squo SomW5gmFca3hTbD+dnxrJzhyvCpH7PaucCiW+NsLrYAgDlIvachci6KCxn1JwCQfwaiO ovmav2hEqsYzVQjajrAVgdN+hBs79Q7Np/QZ2bzlhwWD9kPecFI+dOvqc/v1GbYm0Oao j1/6fJENMZh8ZVrEZtp7Lm41Wy6N6htB796IiBwrypdMTwHihxTvco6FPVm0fAB5bDCs wzSbwVL7hhi3wC+phd6uHBBWFW0WtygpaKext/Rjo7vK2eFBiBBb2dcz37RrygXP9dVL JDhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Ho71eZkBMon4Vz3VLsPtyCt1CUgMlDiLHMKnef2ILSA=; b=kTP4yY40nUVXyM+aVIAl6/Gu8a9M1/CO1i1tGjt/AV5oOytznVPA1cWJBAuBr81rEI 5M/KRygQ2AJqySPWrYqoz/Zj9Vm4fki8J3F8xRIUnESRTb6IaOrov4WFOPKrx2Bthkd5 20kKQOrCedB5ZBbWnc/NFT+47c/f4WGzIcG7bLdR3bnSgkBRuQ0bGyX+hRB8dvyKvq2y /pTciU2xpaImNEtA02p8vlo5udyKdp/v6D8tzGFLig/x1OxeEyZCgx2TpLay1y21upej HZXTvQy+04ukzeZVaaflV1M9pGZGUI6EYIDa/bswmyRwGSDPURh67nwKwSzGcG067UC0 I9mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XRXOcdeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si2621915edq.122.2020.07.15.23.42.03; Wed, 15 Jul 2020 23:42:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=XRXOcdeT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728124AbgGPGle (ORCPT + 99 others); Thu, 16 Jul 2020 02:41:34 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:4367 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727943AbgGPGle (ORCPT ); Thu, 16 Jul 2020 02:41:34 -0400 X-UUID: 23d064985d8c44cb8eb27405b3e6b9e4-20200716 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=Ho71eZkBMon4Vz3VLsPtyCt1CUgMlDiLHMKnef2ILSA=; b=XRXOcdeTwdFN5d5s8jX8hdz6O50rKSfYqC/FF81iO2+b53MPXL5/oC0kr7EVgPUpRORpRoYW96U7jERsz9vZ9HnAyr9cI8T9YQHHcldb5pesSvSRotu9pyGF/T3RirNz9Y82YCsHptjKZZ/PHrJZIhY7f3bsF0ReHtLCijHTROo=; X-UUID: 23d064985d8c44cb8eb27405b3e6b9e4-20200716 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 982203569; Thu, 16 Jul 2020 14:41:28 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Jul 2020 14:41:20 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 16 Jul 2020 14:41:20 +0800 From: Macpaul Lin To: Felipe Balbi , Greg Kroah-Hartman , Matthias Brugger , , , , CC: Mediatek WSD Upstream , Macpaul Lin , Macpaul Lin , Eddie Hung , Subject: [PATCH] usb: gadget: configfs: Fix use-after-free issue with udc_name Date: Thu, 16 Jul 2020 14:41:06 +0800 Message-ID: <1594881666-8843-1-git-send-email-macpaul.lin@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VGhlcmUgaXMgYSB1c2UtYWZ0ZXItZnJlZSBpc3N1ZSwgaWYgYWNjZXNzIHVkY19uYW1lDQppbiBm dW5jdGlvbiBnYWRnZXRfZGV2X2Rlc2NfVURDX3N0b3JlIGFmdGVyIGFub3RoZXIgY29udGV4dA0K ZnJlZSB1ZGNfbmFtZSBpbiBmdW5jdGlvbiB1bnJlZ2lzdGVyX2dhZGdldC4NCg0KQ29udGV4IDE6 DQpnYWRnZXRfZGV2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