From nobody Mon Sep 28 12:32:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 032A436E47A; Fri, 21 Aug 2026 15:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; cv=none; b=PqSUMzvH8gXEYGBwuPRr4MgE5d1PwT0XG177j9v8SzTcibnb3akcgPETzr7dLl/5k12dtsbK4BHDcuc4IEJlxLY/IYcMX2nCk6lbfzmDduPT4Ixv93niuRzdM6LWLG6LD6+BtFh2MYMg/Qd/h5Tnd6EsYCFZmVZsAKSqSY9dlxE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; c=relaxed/simple; bh=XcfBC699KxyVkWM+s5l4pEhTcj2TKtaaAFQw5w+nS/A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pQFmUGYiWmO8BcEgx4En/W02Gu/25Q8c/u6aVIZY7o1Vfv90JX6YdIy37pYabA961wS6BAWWFoLg1GLxWsKDB4Gcx3oJkNDxXni2vQoS/+IT6nNsmFYcAGSxF8c/6F2jAw1v2Xvf27YjZ5X+ROHsWDD61aKYHPwe676aC82HQ/c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jxheQm/7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jxheQm/7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B16BA1F00A3A; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787327172; bh=6vRlUhKx/isRt8LkBmgULalaVLm/JMvZWTxG3KUTR2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=jxheQm/745XBeXUyD6IVCSKIEXlc4OtE/t/EOHTECOhy/ODKkgu11cWkd+lDWEcJ0 m0ivRYx0YFqWaemUf5F7LxGmCSHHdscYHePepA2nuI1C1sQqzLK3I0UZHxLnlEVPCm bE9Saui8oYn2DEnCsAZVCheaOyN8hlTBPYA4J+ltvce5hIUMIAe9iP7bSr43qqkPix qbs4kI6V6lfbVdhnRDHWMO/VoYeaO5hyLokAeEPW8umAlzomGzWfYXcIjlimU3CLcb 2Kc67Ex5L8ZU+wLrt9snManrVkpPnUFKXY2/P1gLgEkW+cis8gdqLUnVx13WwPl8Tl t64dfk90Awp3Q== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wxRRa-00000000UvW-23op; Fri, 21 Aug 2026 17:46:10 +0200 From: Johan Hovold To: Johan Hovold Cc: Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+e5e28c3e953b2eebb16e@syzkaller.appspotmail.com, stable@vger.kernel.org Subject: [PATCH v2 1/4] USB: serial: fix port tear down use-after-free Date: Fri, 21 Aug 2026 17:45:43 +0200 Message-ID: <20260821154546.118809-2-johan@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260821154546.118809-1-johan@kernel.org> References: <20260821154546.118809-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Some drivers for multiport devices access port driver data from completion handlers of shared URBs submitted at attach() or first open() and stopped at disconnect() or last close(), respectively. A simple NULL check before accessing the driver data makes sure that a port state container has at least been allocated, but a completion handler can still race with port tear down. Reorder the disconnect handling so that ports are not deregistered (and their driver data freed) until after all ports have been hung up and the driver disconnect() callback has run so that all I/O has been stopped. Fixes: 2d93148ab698 ("USB: serial: fix lifetime and locking problems") Reported-by: syzbot+e5e28c3e953b2eebb16e@syzkaller.appspotmail.com Link: https://lore.kernel.org/all/6a7e6fb9.ec5dc6cc.21cb3f.00c0.GAE@google.= com/ Cc: stable@vger.kernel.org # 2.6.30 Cc: Alan Stern Reviewed-by: Greg Kroah-Hartman Signed-off-by: Johan Hovold --- drivers/usb/serial/usb-serial.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-seria= l.c index 17edc057a311..a4fbc849c0fa 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1191,12 +1191,17 @@ static void usb_serial_disconnect(struct usb_interf= ace *interface) usb_serial_port_poison_urbs(port); wake_up_interruptible(&port->port.delta_msr_wait); cancel_work_sync(&port->work); - if (device_is_registered(&port->dev)) - device_del(&port->dev); } + if (serial->type->disconnect) serial->type->disconnect(serial); =20 + for (i =3D 0; i < serial->num_ports; ++i) { + port =3D serial->port[i]; + if (device_is_registered(&port->dev)) + device_del(&port->dev); + } + release_sibling(serial, interface); =20 /* let the last holder of this object cause it to be cleaned up */ --=20 2.54.0 From nobody Mon Sep 28 12:32:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 0175636B93F; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; cv=none; b=rybZXGdLdPOjRXt66kgdBuUG1XzaDSNZtIaEb8oLCkhQ8zB1PRyhqrnMqXZAKkch6SKwaqpe9/1KTwCoceK9aQP4poh/S7iGgEyyJEanhEpfx9xAnLMJjNxyhmYmU4jJZaA7iy/XLzzDdqX04c5Jk/i828mQHMvW5qb38TCaMh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; c=relaxed/simple; bh=+NJ107z9nV8AUntTsS7PBzMd4F/86z6wjZkxwerGXM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PmPtPBeY4t3xC0NSR/ZSazGFMZ/c+Kc5PLxUTWEXSHgXn21UUuO4MXNo9Dc/Ls5Zz7fb/EI22QAm7e3jurrgOHUnWKKQBDXqc6RbMnJqVBVjI1Bid76/DG5a0BYvveOtQvQ2pqm3ynJAy4c76jUop4QocHVUNKeMmwOo3L4hRyk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=l1ERU8BK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="l1ERU8BK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1CC71F00A3E; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787327172; bh=DGOkQmPQpj6V+JAHI7HhrOS8gWwmFW+2R33noOQu0ZM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=l1ERU8BK5N+O8pxyNTATSs4oMhS8fy8O/T74xanCJZgch33cb5xwe4nz6nneZvQvQ PYoDTrFQ0rG9Kxfb9gIhgW7AfWnTRp/nGbW60VYozX/Ulw3l4R8edibsXmgXjwxmj/ S62OT9sNKHyb8aZlbeldnGDJ6AABVv8h+CyW1qD2d13N/zFpieewELJ4Ie42u+2e9r ckSr5DUGMPHO72yKgqS+W2qhvBL3MomRFQdcPnOSIeokL8u2hJJHr8JvsXwe4OEvvv poahqkvQoAX+eApChJl/a3veJpxTiw1FXnERVB+x9136ySBAPkX9D0vPZtAOn8KWwI ikurL6JCtQnXA== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wxRRa-00000000UvY-26Qg; Fri, 21 Aug 2026 17:46:10 +0200 From: Johan Hovold To: Johan Hovold Cc: Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 2/4] USB: serial: fix dynamic id driver deregistration race Date: Fri, 21 Aug 2026 17:45:44 +0200 Message-ID: <20260821154546.118809-3-johan@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260821154546.118809-1-johan@kernel.org> References: <20260821154546.118809-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Only free the dynamic ids after having deregistered the driver and removed the "new_id" attribute to avoid leaking any id added by a racing write to the attribute. Fixes: 93bacefc4cc0 ("USB serial: add dynamic id support to usb-serial core= ") Cc: stable@vger.kernel.org # 2.6.21 Signed-off-by: Johan Hovold --- drivers/usb/serial/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index 9e2a18c0b218..295c61afa44c 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -165,7 +165,7 @@ int usb_serial_bus_register(struct usb_serial_driver *d= river) =20 void usb_serial_bus_deregister(struct usb_serial_driver *driver) { - free_dynids(driver); driver_unregister(&driver->driver); + free_dynids(driver); } =20 --=20 2.54.0 From nobody Mon Sep 28 12:32:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 49C0D379C58; Fri, 21 Aug 2026 15:46:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327175; cv=none; b=qibOl4pXHpycmBQox/JrqrDegzb5Ay0Zgo8zh9axzhv1GER4WUu6Ju3Zu2YsZKLhcYAqhzUzjxm98nZAEw+Nc3q7+Hg600RqbLzHVliBeozipVgv3znQosgBDysUotC9TnFR3LBfnpT0k6OW6wYJ7CJ3mFuupuKotAnKzIy89zc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327175; c=relaxed/simple; bh=rboFOSf6ARrwANdNbB1X3pSoLSyQ6jmKppHjr2yjOB0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TeZdD08+a4Eg1nnGCyDp8yPXrTEUadg//wAoT5ksBNLxLO1HReAH7tpSJPuul/GD6A9uN0+hBNP+kyEAX4fvWeP4+28mXuZhKvIzYHq/a5fPQwVMQnXykDdzOHxLwvACOsZQ4J0VBdqjyIbRStHM+5WFPBSCI7rLCqYUaqCntpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=T2Puumhc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="T2Puumhc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B57851F00A3F; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787327172; bh=VKus00+91sYe0XoPOP+SuXFjgEF7I8m+MnZCdlkHChI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=T2PuumhcJ+NwkWruWS5Yb+UUM2w5l7JCuNTX5HThrDO2Tp7pWUETzm56qLq3Nz4At Fh+qrIn64rNsHLoV7zWp0yejRZQ0EHf2KgGpAWtds2TjR8mNhrzhMqI43ajedM87gv Mvu78HVA3U0qktAy/WXl+kMxeiFQcsC+ClVo18J6gQyDNDWZLFr1GAWsvscqeX5udg x73OFHs6UG0wOVmDKTDnKIDDjpznZhRwmENx6L4n/V4OIgkeTJcoPzV+u/h1hpMPP1 +B8iRfBQ1UI/+sMqUIFYqnnzZ6bgRRKdTPIKpMgbs9SlexphbZ9fBLOdtPuTSdSO9u s2UfwQpKfmlQw== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wxRRa-00000000Uva-29Es; Fri, 21 Aug 2026 17:46:10 +0200 From: Johan Hovold To: Johan Hovold Cc: Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH v2 3/4] USB: serial: fix driver deregistration order Date: Fri, 21 Aug 2026 17:45:45 +0200 Message-ID: <20260821154546.118809-4-johan@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260821154546.118809-1-johan@kernel.org> References: <20260821154546.118809-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" USB serial driver modules register one driver for the USB bus and one or more drivers for the ports on the USB serial bus. When unloading a driver module, the USB driver must be deregistered before the USB serial bus drivers so that I/O is stopped before unbinding the ports to avoid use-after-free in completion handlers accessing port data. Note that the "new_id" attributes must first be removed to prevent new ids from being added and triggering a probe of the USB driver after it has been deregistered. Fixes: 765e0ba62613 ("usb-serial: new API for driver registration") Cc: stable@vger.kernel.org # 3.4 Cc: Alan Stern Signed-off-by: Johan Hovold --- drivers/usb/serial/bus.c | 4 ++++ drivers/usb/serial/usb-serial.c | 21 ++++++++++++++++++--- include/linux/usb/serial.h | 1 + 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c index 295c61afa44c..ea1fe5d1e449 100644 --- a/drivers/usb/serial/bus.c +++ b/drivers/usb/serial/bus.c @@ -169,3 +169,7 @@ void usb_serial_bus_deregister(struct usb_serial_driver= *driver) free_dynids(driver); } =20 +void usb_serial_bus_remove_new_id(struct usb_serial_driver *driver) +{ + driver_remove_file(&driver->driver, &driver_attr_new_id); +} diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-seria= l.c index a4fbc849c0fa..11a0ed6d6546 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1469,7 +1469,7 @@ int __usb_serial_register_drivers(struct usb_serial_d= river *const serial_drivers { int rc; struct usb_driver *udriver; - struct usb_serial_driver * const *sd; + struct usb_serial_driver * const *sd, * const *s; =20 /* * udriver must be registered before any of the serial drivers, @@ -1522,9 +1522,11 @@ int __usb_serial_register_drivers(struct usb_serial_= driver *const serial_drivers return 0; =20 err_deregister_drivers: + for (s =3D serial_drivers; s < sd; ++s) + usb_serial_bus_remove_new_id(*s); + usb_deregister(udriver); while (sd-- > serial_drivers) usb_serial_deregister(*sd); - usb_deregister(udriver); err_free_driver: kfree(udriver); return rc; @@ -1542,10 +1544,23 @@ EXPORT_SYMBOL_GPL(__usb_serial_register_drivers); void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_= drivers[]) { struct usb_driver *udriver =3D (*serial_drivers)->usb_driver; + struct usb_serial_driver * const *sd; + + /* + * udriver must be deregistered before the serial drivers so that + * I/O is stopped before unbinding the ports. + * + * Remove the new_id attributes to prevent ids from being added and + * triggering a probe of udriver after it has been deregistered. + */ + for (sd =3D serial_drivers; *sd; ++sd) + usb_serial_bus_remove_new_id(*sd); + + usb_deregister(udriver); =20 for (; *serial_drivers; ++serial_drivers) usb_serial_deregister(*serial_drivers); - usb_deregister(udriver); + kfree(udriver); } EXPORT_SYMBOL_GPL(usb_serial_deregister_drivers); diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 534e6650e2aa..ab0a32a90629 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h @@ -381,6 +381,7 @@ void usb_serial_handle_dcd_change(struct usb_serial_por= t *usb_port, =20 int usb_serial_bus_register(struct usb_serial_driver *device); void usb_serial_bus_deregister(struct usb_serial_driver *device); +void usb_serial_bus_remove_new_id(struct usb_serial_driver *driver); =20 extern const struct bus_type usb_serial_bus_type; extern struct tty_driver *usb_serial_tty_driver; --=20 2.54.0 From nobody Mon Sep 28 12:32:53 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 4A0592DC321; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; cv=none; b=RsSf+KA9ctc+DleBl5DQQGf8P6ow94LPWfpEzW84YpHl454jueEsqExdlnGEsnHubg3/pu61uQRhKqsAXmRhI+kp+91LuQ8hAY02Dbro59BsWcW2TR6krbzC3Nf0Tbzy8gkdujrDbDQ4nwID9Fkbay9miwphD9GWHf/oVoxeQ0E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787327174; c=relaxed/simple; bh=CFjsCPLN31F/H6xKRnSGIkH/oD35roYpiPepEB9lWzY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mqAHIaY8yjfX5UxlbNB+EEe74S/VEWdT9wIcfn3jAfP8HpkA7WlmMaxbXGmbQoIjEBBQDBTl1p8i/XkcewDULcr+Vvzdfo9Se24HTmWcY4eo+rCpPM+TZ50zFtTvGv6AvtP3chq+vx4IHAMdtaIizzTk8V/Z9wngSLSarn05tXo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GWcGc18Q; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GWcGc18Q" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B175D1F00A3D; Fri, 21 Aug 2026 15:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787327172; bh=a2Am6kVDRlYjOsf2KlsDhBCNscdUiToO1GH8R9kQgU0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GWcGc18Qkl2RaUyfm3LRKz/u7ceGhFm/LG+7pAxyAj5w+pwrmq7Z2ilx/Zj3hXala C8RX7BgjE51AuUUIAKfQJSuTeH8JpCmqSiCUvQEO0lrXs7V+j2pFlTi5XUoum/DiF6 fKrTp3Vx6QK5PidmRnn2MnGp6e55641xs5+CCw/JKM+dvt6Szx+yhwGzo9hiqM0If/ 5fXU79VSZkU8YvLpoQVdh6yFMf90ucQwLTfMwM9G7UNOzdy99tNEI3vKwp6shvA0OZ rH3dbpp/UYZcaVkzzwTLcnGnYStZZhTOXqYDEcgQG/zYhOjVvMdxx1WkvlxryTJelS 6IGTdBOXQOtrQ== Received: from johan by xi.lan with local (Exim 4.99.4) (envelope-from ) id 1wxRRa-00000000Uvc-2Baw; Fri, 21 Aug 2026 17:46:10 +0200 From: Johan Hovold To: Johan Hovold Cc: Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 4/4] USB: serial: use iterator for driver deregistration Date: Fri, 21 Aug 2026 17:45:46 +0200 Message-ID: <20260821154546.118809-5-johan@kernel.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260821154546.118809-1-johan@kernel.org> References: <20260821154546.118809-1-johan@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use the new serial driver iterator variable also when deregistering serial drivers to improve readability. Signed-off-by: Johan Hovold --- drivers/usb/serial/usb-serial.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-seria= l.c index 11a0ed6d6546..9c51b44e2284 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -1558,8 +1558,8 @@ void usb_serial_deregister_drivers(struct usb_serial_= driver *const serial_driver =20 usb_deregister(udriver); =20 - for (; *serial_drivers; ++serial_drivers) - usb_serial_deregister(*serial_drivers); + for (sd =3D serial_drivers; *sd; ++sd) + usb_serial_deregister(*sd); =20 kfree(udriver); } --=20 2.54.0