diff --git a/drivers/staging/unisys/visornic/visornic_main.c b/drivers/staging/unisys/visornic/visornic_main.c index f5561008e5921792d02834f80bb8dfedfc6eddcd..af81d3131cb739509277e5f3d93e13eb717c95b7 100644 --- a/drivers/staging/unisys/visornic/visornic_main.c +++ b/drivers/staging/unisys/visornic/visornic_main.c @@ -2091,8 +2091,10 @@ static int visornic_init(void) goto cleanup_debugfs; err = visorbus_register_visor_driver(&visornic_driver); - if (!err) - return 0; + if (err) + goto cleanup_debugfs; + + return 0; cleanup_debugfs: debugfs_remove_recursive(visornic_debugfs_dir);