Skip to content

Commit fabd480

Browse files
walacshuahkh
authored andcommitted
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: d03c720 ("kunit: Add APIs for managing devices") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
1 parent 1eb69de commit fabd480

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/kunit/device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ int kunit_bus_init(void)
5151

5252
error = bus_register(&kunit_bus_type);
5353
if (error)
54-
bus_unregister(&kunit_bus_type);
54+
root_device_unregister(kunit_bus_device);
5555
return error;
5656
}
5757

0 commit comments

Comments
 (0)