staging: unisys: visornic: check for error instead of success
authorDavid Binder <david.binder@unisys.com>
Thu, 12 May 2016 13:14:48 +0000 (09:14 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 05:55:19 +0000 (22:55 -0700)
Changes the conditional logic to check for an error code instead
of a success code.

Signed-off-by: David Binder <david.binder@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visornic/visornic_main.c

index f5561008e5921792d02834f80bb8dfedfc6eddcd..af81d3131cb739509277e5f3d93e13eb717c95b7 100644 (file)
@@ -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);