From 69b377b31be622762ebde5e5e63e8bed2e22bcea Mon Sep 17 00:00:00 2001 From: Olivier Sobrie Date: Fri, 30 Jan 2015 13:22:00 +0100 Subject: [PATCH] hso: move tty_unregister outside hso_serial_common_free() The function hso_serial_common_free() is called either by the cleanup method of the tty or by the usb disconnect method. In the former case, the usb_disconnect() has been already called and the sysfs group associated to the device has been removed. By calling tty_unregister directly from the usb_disconnect() method, we avoid a warning due to the removal of the sysfs group of the usb device. Example of warning: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 778 at fs/sysfs/group.c:225 sysfs_remove_group+0x50/0x94() sysfs group c0645a88 not found for kobject 'ttyHS5' Modules linked in: CPU: 0 PID: 778 Comm: kworker/0:3 Tainted: G W 3.18.0+ #105 Workqueue: events release_one_tty [] (unwind_backtrace) from [] (show_stack+0x14/0x1c) [] (show_stack) from [] (warn_slowpath_common+0x5c/0x7c) [] (warn_slowpath_common) from [] (warn_slowpath_fmt+0x30/0x40) [] (warn_slowpath_fmt) from [] (sysfs_remove_group+0x50/0x94) [] (sysfs_remove_group) from [] (device_del+0x30/0x190) [] (device_del) from [] (device_unregister+0xc/0x18) [] (device_unregister) from [] (device_destroy+0x30/0x3c) [] (device_destroy) from [] (tty_unregister_device+0x2c/0x5c) [] (tty_unregister_device) from [] (hso_serial_common_free+0x2c/0x88) [] (hso_serial_common_free) from [] (hso_serial_ref_free+0x3c/0xb8) [] (hso_serial_ref_free) from [] (release_one_tty+0x30/0x84) [] (release_one_tty) from [] (process_one_work+0x21c/0x3c8) [] (process_one_work) from [] (worker_thread+0x3d8/0x560) [] (worker_thread) from [] (kthread+0xc0/0xcc) [] (kthread) from [] (ret_from_fork+0x14/0x24) ---[ end trace cb88537fdc8fa208 ]--- Signed-off-by: Olivier Sobrie Signed-off-by: David S. Miller --- Reading git-format-patch failed