mirror of
https://github.com/torvalds/linux.git
synced 2026-09-13 15:40:03 +02:00
xhci: dbgtty: Drop extra call to idr_destroy()
idr_destroy() is already called on error paths in dbc_tty_init(). Do not call it again on exit. For symmetry with the init side, also use IS_ERR_OR_NULL() to gate the exit steps. Signed-off-by: Lucas De Marchi <ldemarchi@nvidia.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://patch.msgid.link/20260806142113.2436238-10-mathias.nyman@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
25b8dfc134
commit
d4dd5d43fa
|
|
@ -665,11 +665,11 @@ int dbc_tty_init(void)
|
|||
|
||||
void dbc_tty_exit(void)
|
||||
{
|
||||
if (dbc_tty_driver) {
|
||||
tty_unregister_driver(dbc_tty_driver);
|
||||
tty_driver_kref_put(dbc_tty_driver);
|
||||
dbc_tty_driver = NULL;
|
||||
}
|
||||
if (IS_ERR_OR_NULL(dbc_tty_driver))
|
||||
return;
|
||||
|
||||
tty_unregister_driver(dbc_tty_driver);
|
||||
tty_driver_kref_put(dbc_tty_driver);
|
||||
idr_destroy(&dbc_tty_minors);
|
||||
dbc_tty_driver = NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user