From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7D2D21E6DCF; Thu, 30 Jan 2025 14:27:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738247262; cv=none; b=O9ySV5i9RgcH85GsPplyNuCwX25V8o4OfefmhHBWw6tAonA/k0YypSPLd0siPuilJQuP04SxvY4FlhFEBPeFolvdAACbu2ehIDOEd3PcDgj+mbu+ExcwBqZy6rBPDKEBR3fSMQQmwQemoTlb/deoLvingM+MQDQ9Yp+sVmi5r8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738247262; c=relaxed/simple; bh=rnShHZtUrRSR6DY4tBLADhQTNwVZf49jDRA3D+fgmOg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bRMHfLfyjhMu/uaQihnV6SNndARwNqoEpJRlFZUK4HtN2CAdycqN8elhEvK0s/5644wA/Ji75rQrYXn/rb5fvqTnNunL1VVadFjknlk+b/Dv7711dUhKT6hJYvlBTpv3jMt2hbtolSq3Nrmax1dlNn3ZYlRFXJdT6sA3xLmtiRw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=magKraLi; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="magKraLi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BA7DC4CED2; Thu, 30 Jan 2025 14:27:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738247262; bh=rnShHZtUrRSR6DY4tBLADhQTNwVZf49jDRA3D+fgmOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=magKraLiTKtksPandRDiv7/bE/PV8A8tPRuICqLkuJ7BiLWci8vuptoA4DHqJocWy d2sTYiNBupaxOSAoNCWPkbS2P4OKDMt8jsppfVVcY3BBOUpZYM6AFA282Waysksp7J VS/C2OFzKZAD7oto18isIUrCeX34Gi01qB8D6DxQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jon Hunter , stable , Lianqin Hu Subject: [PATCH 5.10 130/133] Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null" Date: Thu, 30 Jan 2025 15:01:59 +0100 Message-ID: <20250130140147.764128486@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250130140142.491490528@linuxfoundation.org> References: <20250130140142.491490528@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Greg Kroah-Hartman commit 086fd062bc3883ae1ce4166cff5355db315ad879 upstream. This reverts commit 13014969cbf07f18d62ceea40bd8ca8ec9d36cec. It is reported to cause crashes on Tegra systems, so revert it for now. Link: https://lore.kernel.org/r/1037c1ad-9230-4181-b9c3-167dbaa47644@nvidia.com Reported-by: Jon Hunter Cc: stable Cc: Lianqin Hu Link: https://lore.kernel.org/r/2025011711-yippee-fever-a737@gregkh Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/function/u_serial.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/gadget/function/u_serial.c +++ b/drivers/usb/gadget/function/u_serial.c @@ -1395,10 +1395,6 @@ void gserial_disconnect(struct gserial * /* 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) { @@ -1410,6 +1406,10 @@ void gserial_disconnect(struct gserial * 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)