Commit fabd480b authored by Wander Lairson Costa's avatar Wander Lairson Costa Committed by Shuah Khan

kunit: unregister the device on error

kunit_init_device() should unregister the device on bus register error,
but mistakenly it tries to unregister the bus.

Unregister the device instead of the bus.
Signed-off-by: default avatarWander Lairson Costa <wander@redhat.com>
Fixes: d03c720e ("kunit: Add APIs for managing devices")
Reviewed-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 1eb69ded
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment