mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 23:16:39 +07:00
USB: g_hid: unregister platform driver on probe/usb_composite_register errors
Otherwise reloads will fail. Signed-off-by: Peter Korsgaard <peter.korsgaard@barco.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
fe662b4352
commit
da01c7a49b
@ -275,8 +275,18 @@ MODULE_LICENSE("GPL");
|
||||
|
||||
static int __init hidg_init(void)
|
||||
{
|
||||
platform_driver_probe(&hidg_plat_driver, hidg_plat_driver_probe);
|
||||
return usb_composite_register(&hidg_driver);
|
||||
int status;
|
||||
|
||||
status = platform_driver_probe(&hidg_plat_driver,
|
||||
hidg_plat_driver_probe);
|
||||
if (status < 0)
|
||||
return status;
|
||||
|
||||
status = usb_composite_register(&hidg_driver);
|
||||
if (status < 0)
|
||||
platform_driver_unregister(&hidg_plat_driver);
|
||||
|
||||
return status;
|
||||
}
|
||||
module_init(hidg_init);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user