mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-16 13:34:30 +00:00
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: Wander Lairson Costa <wander@redhat.com> Fixes: d03c720e03bd ("kunit: Add APIs for managing devices") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
1eb69ded80
commit
fabd480b72
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user