Message ID | TYUPR06MB62177737F0054278B489962BD2812@TYUPR06MB6217.apcprd06.prod.outlook.com |
---|---|
State | New |
Headers | show
Received: from APC01-TYZ-obe.outbound.protection.outlook.com (mail-tyzapc01on2082.outbound.protection.outlook.com [40.107.117.82]) (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 032D0817; Fri, 16 Aug 2024 11:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.117.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723807291; cv=fail; b=Q1bw13w/IbrJC4Jg8S5UprGDzSw2xL8gYl1mfqvrTC9tmx7gczZhBkYzCW8zBCHMbaOxCNI6thUfo0vo0NyIo3syP7UUBuvOna54nSdVWZA2Y9OxM2JwSwnEuB3SnrFMIOoZPsCOw0c+rOrhOQB0S+lHq8f6waihff6q/oWe+JU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723807291; c=relaxed/simple; bh=UF+EA2RZhVgZSgg9buAA7/TSmF28FqAp8yHNXI+1EOo=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=MDG0P8xwndeleWjyWWnouofNcqVJuVz7T9U95c0p7wHLg6mKmQF9ne2cRn26Tv3LH5PZpjbssVLG7K8haotZ0yCXnMqAY46WlgtXYtR79k71PZp+4x4ADP1F+UwD2YZjboTOftpMSi886eRrcrrBKkIw9ETjFnSWjJAjeLtSAJc= 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=jWsFACDA; arc=fail smtp.client-ip=40.107.117.82 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="jWsFACDA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=s5iyjdPRH/RTTmUoDJaFoueJkImFJcIrVc1sqnuSd01Ww0agZobmeYc96NzOWSaD2OZoxsnGf+NGYTuKjtSh8RKtWoGj4p+l4JerD0qBgfGW+tfbvGRQRrMM/NoNp7ZXRJzYmrTd2vwlKPuwCAd7bYH2VP6j5GVsigUafZAv46S+0e6gf9FB4u1LSOdRX29Du49QK1GPkeZgQ/1MATtUEisRohTsdcnl6FLSFF0GrY0hCecvHmFip0epaKw0AaQbTGofVV1msyX6GbRcoxiEjXX6QZ0/28v+tNVMGCEI+1P2JqoxD3hdskM/w0LmQQoo2r8SXAzghhRx8CaoHY507Q== 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=UF+EA2RZhVgZSgg9buAA7/TSmF28FqAp8yHNXI+1EOo=; b=UTVoXHNe/aw/o5+iIT/GGkiEgtpp9o/0G3BqEDOxfRmevvPvL+cDQZE9GWAb1eoRGuCZXc5eVOVNsru80XSbtRj4TwKzu4PfXvvaDvf/F5xfuVP7Sk/QhDbrcVYq1s98SoGcgQz7wkcCr4ERJY3iEWBWwfJKPePKB7QEfUknHrIjVFmIiEEGx3Hv3XpzZoGxJvCiMrwsEclS86aGQlXXUN1zNs05fz9fDHYkJXZSLkqUfaSGuftxfGfxOnR9l34psTviT4BFFm+dbhuBNglY/5EwCIdeIL1J/oZ0ybY/u05BcaTuz3QLOC7wMfP1Jquh0MSOi9prIITva381Pa6Jww== 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=UF+EA2RZhVgZSgg9buAA7/TSmF28FqAp8yHNXI+1EOo=; b=jWsFACDAv5bRRfRNhop8d0m7QknHDRtE4fdVbh62kqzsT2h2qXrwLC3+k8/JGfLuqbfHK3P/W4zpHC39IUOJVyb8RE1jscA5AlXbbxoUS6rnPmKuEARvLCoelUM6VdKMzFGPp5an5bgifj/48wu9o0uJtbUlgDcaMPduR4zLDRVWLwroITRi2u6QF4AY2KXZyRTo3xf+IuGRCQjuydH2ObSetxzqKecHxvw3LZ+dUBK1PlAC+lJzKXs5GZINngPBKWNcjVOKWSvqAhH04br3uUgK5KlXG+9Xg2HKH78/j1lVcVy7eqw/qINGnnGH7ausXTjjffKnTA6+O53EnqRngQ== Received: from TYUPR06MB6217.apcprd06.prod.outlook.com (2603:1096:400:358::7) by PUZPR06MB5981.apcprd06.prod.outlook.com (2603:1096:301:115::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7875.18; Fri, 16 Aug 2024 11:21:24 +0000 Received: from TYUPR06MB6217.apcprd06.prod.outlook.com ([fe80::c18d:f7c6:7590:64fe]) by TYUPR06MB6217.apcprd06.prod.outlook.com ([fe80::c18d:f7c6:7590:64fe%4]) with mapi id 15.20.7875.016; Fri, 16 Aug 2024 11:21:24 +0000 From: =?eucgb2312_cn?b?uvrBrMfa?= <hulianqin@vivo.com> To: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>, "quic_prashk@quicinc.com" <quic_prashk@quicinc.com>, "quic_jjohnson@quicinc.com" <quic_jjohnson@quicinc.com>, "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org> CC: opensource.kernel <opensource.kernel@vivo.com>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "akpm@linux-foundation.org" <akpm@linux-foundation.org> Subject: [PATCH v1] usb: gadget: u_serial: check Null pointer in EP callback Thread-Topic: [PATCH v1] usb: gadget: u_serial: check Null pointer in EP callback Thread-Index: AdrvzihtFNSOcxRwTAOIHI6tveAOMA== Date: Fri, 16 Aug 2024 11:21:24 +0000 Message-ID: <TYUPR06MB62177737F0054278B489962BD2812@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_|PUZPR06MB5981:EE_ x-ms-office365-filtering-correlation-id: 91712cd2-9b0e-47c4-4cdb-08dcbde59016 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?alc4VUg1d0tIL3BzaFVmZ2JReHBO?= =?eucgb2312_cn?b?bnBuQ2V3UlIyRzFpVjdzMVM2a0ZaWkIzRTJWY010QVA4NWVQNHVGbW9PbGhrOE41?= =?eucgb2312_cn?b?TklSTzE0QTlIQXZXejVzLzA5TUJJQVMxeGRYbVR6S1hBWjM2QTNFUW4yMUdaVndY?= =?eucgb2312_cn?b?eEZjZzFuRXJkSzF3SmRtNmtnSVlreWFxVTlDNjBEUmM5QTFwWi96andZZGFGRHJ1?= =?eucgb2312_cn?b?aEpWb0VPMnFoZC9tKzVWanplbVpXaVpZYmZ5V2x2eE5acXppeTh1aEFDVndmSmhr?= =?eucgb2312_cn?b?dE9qYXhwK1VURjFJb2doTHJmK1c0ZU9aLzdWbXRl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5UzFUZlpZQ1ZpQmNERW9VR1U4?= =?eucgb2312_cn?b?YWRYT0d5MVVSRWw2eVhONEtpNXJaTndRazg3cEQ3NWowQk52VFZhRHd3aVFQalNP?= =?eucgb2312_cn?b?c3E0S1QvYStGTWcrR29rTUV5SDJQTVRMK1pzNE1WUzNzblppTzVkWmtaUnlQRGNt?= =?eucgb2312_cn?b?eGNGL2hlbDZHTUJJMzUwKzRVQ1FoK1RPTEROWVJ2ZExzOUpia0NialJyditTMXVv?= =?eucgb2312_cn?b?bEtCUmRxSzRMTmRDUTExdjFlMXkwZTdWa3B5TGdHVkZ0ZlE3QjlaZ3UrOFU0d3dB?= =?eucgb2312_cn?b?clR4azJVODlOUTRJTHN4bDRTNXI3K2M3V2ptaTVHUVNIc2tzby81V1R0bXp2Ny82?= =?eucgb2312_cn?b?RTl3M2VvYkprVGg5ajFSeFNtQ0dKTWdQY21lU2trM2M1TDJ5d3FsRFB2YTRNMDBP?= =?eucgb2312_cn?b?cmp3THQ1M3ZCNUFoS00wQU5reVVTZmRWYjFPZXUyc0hxT3I5U2g2dm5FM2NLYnhR?= =?eucgb2312_cn?b?cmtyemhQZm1rY2k5Q1FiaVpCcnp6QlhQNTR0Yzd6VFRXS2E1WUhBVEhGVmg4U0k5?= =?eucgb2312_cn?b?VW01TytZcHQyeE81bVFrK2dRSFpDZGJ1V0xTV1JSVWY5REY3SUo3OGlSYVNXclBy?= =?eucgb2312_cn?b?YVNSZTJuc2VVaC9xbWpnRXZBV3VzVWd3MjI1aXhiZmw3MFp3UEx0cjJ0T0tPSCtj?= =?eucgb2312_cn?b?WE5qQ1ZVK04wakhpTXQ5NXdScjRLaWdlQkJFdHYvVk9Ya1dIMVhHZHJ4ZkRtR01a?= =?eucgb2312_cn?b?WjdmbmNLRlVXblBtak5MVGc9PQ==?= 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?MWx6elFENFVoZGlOT3JkUnVl?= =?eucgb2312_cn?b?Zm0zMTJaT1RsWExIVVU0cGpsejhnclcyT1VsR25lekhsOGwyNU5jcU9RK25lSVlZ?= =?eucgb2312_cn?b?c3lZckVQbTRLbW42akRYYndqU1JKNmRySFIxcytVUWx2YzRqNlh3RC9UQnl2NlRa?= =?eucgb2312_cn?b?dEpWVVFuYm5zL29ISC9LcytmbmdPS2tkeGRXNU1XYVU0MG5yb0hCNTEvL2Q2S3Fs?= =?eucgb2312_cn?b?UlB5MnVpZHVpbFNGcVQ3QU9yeGc2TktNdXpCWVBTVnpNemdRaVNEWTFBVTZYN0lU?= =?eucgb2312_cn?b?YTJHK2psZHRNZVgvcnMvendyTmpVUkt4ZkJya1VuOW9zZmF6ZlloeUhtMWdtLzJl?= =?eucgb2312_cn?b?dDRIcGxzOUpOVnh2aUYzYjAyUVc4MkQ2cVRma0dGb0RiUTdIbWdyU2t3dEUydGtI?= =?eucgb2312_cn?b?eTQ5NDR5OHgwUXRPNXZtK0x1MWZ5c0hoekR6Q2xaQk9ENFV3UTdXSEUzR1pwS1Br?= =?eucgb2312_cn?b?WGJxNkRGUEVXdWE1WjNrbVNVMjFuQzV3cjlJRXA1MDRsU3RGZ2gvais3eDZCaFZU?= =?eucgb2312_cn?b?bGRId1BMZDFBcVFORzFyRHNwVlc0azU1bDc0YzNQSjNJWk9ERjlzbm9IdWwxaXB5?= =?eucgb2312_cn?b?NGhuWXRhUDVLMmUycDh3VWNWbjhmVjdCT1dISWRSclN3WGhMUTE5a0N3OWh4NDR2?= =?eucgb2312_cn?b?OE9PRWgwUWFCTkdDQUlqQlZwWjEwdGtWQWx0eGVkQTJIV2htZEZ2WlFKOEZTdysx?= =?eucgb2312_cn?b?MENWMk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?emNUZjNKbmtacnpkUzRiTlpZa2owRGNVc3JXMWlNSW8zcEQ0aEtnSytlcURVc2tZ?= =?eucgb2312_cn?b?aVhlMWxxMVFhZmRsSG9NZSsrQTluMnhydWVxRFA4dEw0WkVsYjlOaUdOT2Nzd21o?= =?eucgb2312_cn?b?Vi9tNTlPMUdIVnRWbUdIVU53aThrRjVBWlRpazVLdm1ZYTdtZ1QvV05pb2V4bmJa?= =?eucgb2312_cn?b?Tndvams1ZjExbkhOOVlLU1hQaWhiQmlqU24venUrblNCQWd5dXZIMFRZemF0SWEz?= =?eucgb2312_cn?b?dkdDWE5OU3FoQmp1T0YxZ1p5T3NtZDdHVDdtcFNBODNtVG5sN1RhNTNQY1FRSWli?= =?eucgb2312_cn?b?QUZBUHRMYnhMT2NwTkdSQU5IRzhlY0JaK2tSZ2dKQzQ5dnBtL0FsdzMzYm9kaHoy?= =?eucgb2312_cn?b?UUNnOU4vM2N3T3pZVXFCVDJBZHFHZm96VXRMSXJ6OXJyL3Mxc0NyNGtuR1kvR0tn?= =?eucgb2312_cn?b?T092T09kS2dmbEg0WS9DbERVbUlhY0V1TUtDbGlYTnV1cno0dUZKTHdiT1JCNDFU?= =?eucgb2312_cn?b?cGEyWU04Mkx3MUV0bnR3Mml5Z0ZQT0h1ND0=?= 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: 91712cd2-9b0e-47c4-4cdb-08dcbde59016 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Aug 2024 11:21:24.2250 (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: XQbJpkyTp38ryCbrbgJSco1aOlWhpBcdosnvCy30mMD9MMXYzsFexUOMG7fMf/AwES5x6ogerrzjS5S5uevbyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PUZPR06MB5981 |
Series |
[v1] usb: gadget: u_serial: check Null pointer in EP callback
|
expand
|
diff --git a/drivers/usb/gadget/function/u_serial.c b/drivers/usb/gadget/function/u_serial.c index b394105e55d6..65637d53bf02 --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -454,6 +454,14 @@ static void gs_read_complete(struct usb_ep *ep, struct usb_request *req) { struct gs_port *port = ep->driver_data; + /* When port is NULL, return to avoid panic. */ + if (!port) + return; + /* Queue all received data until the tty layer is ready for it. */ spin_lock(&port->port_lock); list_add_tail(&req->list, &port->read_queue); @@ -465,6 +473,14 @@ static void gs_write_complete(struct usb_ep *ep, struct usb_request *req) { struct gs_port *port = ep->driver_data;