kunit: unregister the device on error
authorWander Lairson Costa <wander@redhat.com>
Fri, 19 Apr 2024 13:25:01 +0000 (10:25 -0300)
committerShuah Khan <skhan@linuxfoundation.org>
Mon, 6 May 2024 20:22:02 +0000 (14:22 -0600)
commitfabd480b721eb30aa4e2c89507b53933069f9f6e
treebc733c1928b97aca0c05d7968e1f891f142eb1fa
parent1eb69ded805103ce3ddc8b1a207abd8c24ca9e63
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>
lib/kunit/device.c