Message ID | TYUPR06MB621733B5AC690DBDF80A0DCCD2042@TYUPR06MB6217.apcprd06.prod.outlook.com |
---|---|
State | New |
Headers | show
Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2081.outbound.protection.outlook.com [40.107.255.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85F74A29; Tue, 17 Dec 2024 07:58:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.255.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734422333; cv=fail; b=kQFi0DHruHoqjX7t/eYcXOnj3cu+kNqU5s/0LLDcgdpmrwHToCS2RiQbqs1PaIOH7wmQP/TpJLw5l4z6qzrjJ0dRDkn3YGAkonz1iyrDEfv7OW0sV/qPKmjcEGBxRssSexciwjyTmBgD7LPq2THE5jS78EE0XEnU6xiiCe4LCkQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734422333; c=relaxed/simple; bh=3wcSnRRZELF3fJKPH1lIhnRy/mM2LvyaExyO+sootHo=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=HlKG+AFTDZjyfARZWvpI/N2UIO3yFm2Bs/zT+GZnM0/wJZiyln2dpCNeDWf7lFfCNykkzDhV+YqIy953IGpSv7BsQTE5uiJBFU53MQCuEjy+EAmUcfqp9tw8AgGa4iNzLASCvGzfc/peA6rjLe9dBdcL+a3Y2rhHtriUuu79U5s= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com; spf=pass smtp.mailfrom=vivo.com; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b=jeqaYK8A; arc=fail smtp.client-ip=40.107.255.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vivo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vivo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vivo.com header.i=@vivo.com header.b="jeqaYK8A" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DWLNX4Cc3z9dDP29r5DaZqCToN1lGKTbtK4S8+7sGk1/mmwAPeTNR1JroZhZnHiW5mPb/8HjxMrFGlOVAV1MJFcrhiZfFe+Fq7pXcNgaL/kaQmI9HuhdAb8NMKqA+V8tWG6K0Z5N1mDjt3bYlqb+RruipIAHi6GZioqIdUpxPHEu964ezgqSPGsglzgTecvY2HnjLAlg/727XhCOteVUHxCHOS/umDDsCTBLzZ76MTc32cA1NFDym2Dwtrdb7BS5XmHTleQUA0i0p/lYgLef9v5pYrHFqJhHLbqmGGpIdEIH37Fq17b/Pm93iOQQg1VNp7+H76pO3W2PhMPIcR0MUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=3wcSnRRZELF3fJKPH1lIhnRy/mM2LvyaExyO+sootHo=; b=cvjzL1LWJaVF65wR19z2ZN+ilS6RBSHOyxWGihuaPvHHNSGN+luuV9mlBvC1ZqzxFq63xar5aTE1OWoeMWazx9abNTv9LcCgJ6BPJVrhWD5Ovpgg/Ub4N+CkHrom11RZZf05auucWjd5akORoSd2Uv/MHmWT71trP7Oqs3g4z7vSF1grT+q46c5aqGA4Neg57VaPtvL+vE/rcBLgH9Gc3h8nva3I/MeZtcTZj4akDQF8pwReEcKH6qBBDysxIq2SWLO952O0no4M/lx7w3ADKud/oSMJUG3hj3PD0JcdrrN8hJYBN00N/X9TX8+Y2MCbelxXuj2gPGhqOAbotEVB2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vivo.com; dmarc=pass action=none header.from=vivo.com; dkim=pass header.d=vivo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vivo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3wcSnRRZELF3fJKPH1lIhnRy/mM2LvyaExyO+sootHo=; b=jeqaYK8AEnA2cUm6wnshQcFV6CCjadeMtf9HPsSJoCrRTrTrgF+lPc/8YGi+DCFabXBDuoNBvX+VrtBvt/RfXKjpsLR7vR5gXpAS5RP4oudFtBJ/DbJkCdqIBln1vWnfPAaLkOyu4/lH5m1LTDGTJyNSKd1E1Zy1qsEiugVmPFlb6r1n7Wl6F/8pii7ClOZE1O2+RFxt+TipNEY4Q0eKwscEC2KdMDJxeVzaqxBNOLcVH8zrPK0CmBWbHg1qrY0OK8tTV1O5BABbsu9AyfPo8x0A0YomJHVX5vSwzEfu/awhhgOefGVvJOaP2sxzP4dkYjhamkbjD3X9PIpkmCabVg== Received: from TYUPR06MB6217.apcprd06.prod.outlook.com (2603:1096:400:358::7) by PUZPR06MB5517.apcprd06.prod.outlook.com (2603:1096:301:fe::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.11; Tue, 17 Dec 2024 07:58:44 +0000 Received: from TYUPR06MB6217.apcprd06.prod.outlook.com ([fe80::c18d:f7c6:7590:64fe]) by TYUPR06MB6217.apcprd06.prod.outlook.com ([fe80::c18d:f7c6:7590:64fe%6]) with mapi id 15.20.8272.005; Tue, 17 Dec 2024 07:58:44 +0000 From: =?eucgb2312_cn?b?uvrBrMfa?= <hulianqin@vivo.com> To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>, Prashanth K <quic_prashk@quicinc.com>, "mwalle@kernel.org" <mwalle@kernel.org>, "quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>, David Brownell <dbrownell@users.sourceforge.net> CC: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, =?eucgb2312_cn?b?uvrBrMfa?= <hulianqin@vivo.com>, opensource.kernel <opensource.kernel@vivo.com> Subject: [PATCH v3] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null Thread-Topic: [PATCH v3] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null Thread-Index: AdtQVu3p636G49OMSa2yDMmE+bdUDg== Date: Tue, 17 Dec 2024 07:58:44 +0000 Message-ID: <TYUPR06MB621733B5AC690DBDF80A0DCCD2042@TYUPR06MB6217.apcprd06.prod.outlook.com> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vivo.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: TYUPR06MB6217:EE_|PUZPR06MB5517:EE_ x-ms-office365-filtering-correlation-id: 67914c1d-a921-46e7-b7b2-08dd1e70a11a x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0;ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?eucgb2312_cn?b?QWpBZXV4c2xLVWNuT3dYMm5SZXVK?= =?eucgb2312_cn?b?aThkK1BmWVQ1a0tja1U0a01yMDRsZWIrYnVqQ0ZyaC9WVkdDcVVveHBoUnU3UHBw?= =?eucgb2312_cn?b?VVc3dmVxd0hQTHpzNVdXU1I1eGlGV3BqcXY3ZjRnUE0xKzNKdlEyaGlkeVpVbzFl?= =?eucgb2312_cn?b?TjFpUEZ3RUpiYWZnbDFJL0hQVFBLclFkcTRNSDdSWUYvMGdSckIwd3BEL2kwcEM5?= =?eucgb2312_cn?b?eG5xOWVwcUZFa1FEZTJNWlozWEQrVGFxOGVvSG1mQ05tNF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3BIZXdzSEIxbTl6?= =?eucgb2312_cn?b?c2VnVHhsMjArbXY=?= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:zh-cn;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:TYUPR06MB6217.apcprd06.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(366016)(38070700018);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?bjBsSkhrNytIeDVabktJVnoy?= =?eucgb2312_cn?b?MFVaYVRkZ3NBOGdjRHNkTlc5VE85KzkwNWMreG00dDZjU0FEYnk2ZmZseFhHMlBs?= =?eucgb2312_cn?b?Mm0yb0NESkRNMkVFZkRsZ1htS25LOGszMk9oUmtmek9BaW9NR1J6QjZGU3Nua25L?= =?eucgb2312_cn?b?QjlldXpYT3UwV2ZhUHpqclkzazBkbEk3ZDVwUjJHMTJrSWJwQ1BlSVRDVUp0UmNk?= =?eucgb2312_cn?b?b2pzV1huVEw1MjRlT3JjWFhicnFUa0pqd0c5UlpvNlZlNjA4UUVFbm5nZjBtWlVn?= =?eucgb2312_cn?b?clVoNzRxekJkckxuOVNsbnpKZHF2eHhUUWtRcFZ2MmsvQTk1RGtZdDBrTkZTOURE?= =?eucgb2312_cn?b?VFVKdEFFVHdDMDNvakx4dDFOU0ZzZEZJL2N6Zjh2REVVWkJGd09qaFA1N1RPams1?= =?eucgb2312_cn?b?ZFBsWmF3WUE4UDJiNVB1dFllNjNQOTMySUxsM1hiNTU2NFY0UW93aUVZYnNFRi93?= =?eucgb2312_cn?b?MVhqOC9tUDlYcW85Wmk5Q3lrWjBDMUp0eDU5dG5CYkg3alU1S1UzL1VaR1dLd29C?= =?eucgb2312_cn?b?NzJ6cnZ0T1lwOXZIbVd2aytmNjJPNjdRVUwxc3lsN1ZFR09zQkw5MXhFY254TFJ3?= =?eucgb2312_cn?b?QWdDR0RETHJHK1hnclJMSUFwZ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0hDTUVJSE1oZWxCYXB0L3h1V0R2UWtKOGhBcyt3?= =?eucgb2312_cn?b?MTU2eXdkbmlpblRCVjVmNVRXUjFiTTZxcHJFV0o2cnlmdWV3bURkdVIydkpOQmor?= =?eucgb2312_cn?b?Uk5aVDlFZllFQnNWb3NBL0FpL3BsSkQ2UnVDWGNURDQreFI0d1Jsajh0Y2xSTDRR?= =?eucgb2312_cn?b?YWE1N3pEN096T2V4L1lrbG1LRWtFSXdqaTJQblFIejFIdzVRZ2EzRjAzbHo4VGNs?= =?eucgb2312_cn?b?bWh5b3RHVnB6VkxKak01NFd0R0dHMldiZGQ1TWNUNzlFSWJpSEU2SjRPNTR1a0lz?= =?eucgb2312_cn?b?UWdjb0ZXQjU3ZmVCT3M4T244NklsdFFxQis3bkhZb3B4M0pYUFh3TTlOQVZCT2hj?= =?eucgb2312_cn?b?NktpSXIzZXg1VlM1dldPSmZwZUpJbnhvUmJvZkNUZVJMclN3dE5JYTIxdkhKQ0Z0?= =?eucgb2312_cn?b?RGVjZEMwYjZPeGlWSU9hR0JDcjhOQ0R6Wnl2SkhXdEd2eUYraHd3TS9yOHNzZTdj?= =?eucgb2312_cn?b?OXV4eFBEUGtIS1FtMTdzYzVvU2FvWGdybFplZVk0RTJRQmNLaGVUdjNBRm5ZSEc2?= =?eucgb2312_cn?b?eEYwenlTNmR4OWtYWDFHVkpiSHdxWmcza2cwbkl1dCtQcGxzNE4xeGVsOVJBalNH?= =?eucgb2312_cn?b?SWZzREVCV3B0U1BoK291QmNlSnFLS245TT0=?= Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: base64 Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: <linux-usb.vger.kernel.org> List-Subscribe: <mailto:linux-usb+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-usb+unsubscribe@vger.kernel.org> MIME-Version: 1.0 X-OriginatorOrg: vivo.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TYUPR06MB6217.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 67914c1d-a921-46e7-b7b2-08dd1e70a11a X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Dec 2024 07:58:44.3914 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 923e42dc-48d5-4cbe-b582-1a797a6412ed X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tWB1dFMvPLJ5PdULwhl0d6aHFqV7f4XkXLTv/xIvJACWD3o1RecXHHDoZ08xsz3/ZrP+xq8+E5RsJlHqGf1xRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5517 |
Series |
[v3] usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null
|
expand
|
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index 53d9fc41acc5..bc143a86c2dd 100644 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1420,6 +1420,10 @@ void gserial_disconnect(struct gserial *gser) /* REVISIT as above: how best to track this? */ port->port_line_coding = gser->port_line_coding; + /* disable endpoints, aborting down any active I/O */ + usb_ep_disable(gser->out); + usb_ep_disable(gser->in); + port->port_usb = NULL; gser->ioport = NULL; if (port->port.count > 0) { @@ -1431,10 +1435,6 @@ void gserial_disconnect(struct gserial *gser) spin_unlock(&port->port_lock); spin_unlock_irqrestore(&serial_port_lock, flags); - /* disable endpoints, aborting down any active I/O */ - usb_ep_disable(gser->out); - usb_ep_disable(gser->in); - /* finally, free any unused/unusable I/O buffers */ spin_lock_irqsave(&port->port_lock, flags); if (port->port.count == 0)