kunit: unregister the device on error
[linux-block.git] / lib / kunit / device.c
index abc603730b8ea4e55e320419b671130a2266f0a3..25c81ed465fb77cccfc4bb0c0d4e3fdb548a4dd4 100644 (file)
@@ -51,7 +51,7 @@ int kunit_bus_init(void)
 
        error = bus_register(&kunit_bus_type);
        if (error)
-               bus_unregister(&kunit_bus_type);
+               root_device_unregister(kunit_bus_device);
        return error;
 }