diff options
author | Wander Lairson Costa <wander@redhat.com> | 2024-04-19 10:25:01 -0300 |
---|---|---|
committer | Shuah Khan <skhan@linuxfoundation.org> | 2024-05-06 14:22:02 -0600 |
commit | fabd480b721eb30aa4e2c89507b53933069f9f6e (patch) | |
tree | bc733c1928b97aca0c05d7968e1f891f142eb1fa | |
parent | 1eb69ded805103ce3ddc8b1a207abd8c24ca9e63 (diff) |
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>
-rw-r--r-- | lib/kunit/device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/kunit/device.c b/lib/kunit/device.c index abc603730b8e..25c81ed465fb 100644 --- a/lib/kunit/device.c +++ b/lib/kunit/device.c @@ -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; } |