Patch "kunit: unregister the device on error" has been added to the 6.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    kunit: unregister the device on error

to the 6.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     kunit-unregister-the-device-on-error.patch
and it can be found in the queue-6.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit afc4a1e599c0c5fd8788b5ad9ab59b5c67bfed5d
Author: Wander Lairson Costa <wander@xxxxxxxxxx>
Date:   Fri Apr 19 10:25:01 2024 -0300

    kunit: unregister the device on error
    
    [ Upstream commit fabd480b721eb30aa4e2c89507b53933069f9f6e ]
    
    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@xxxxxxxxxx>
    Fixes: d03c720e03bd ("kunit: Add APIs for managing devices")
    Reviewed-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/lib/kunit/device.c b/lib/kunit/device.c
index 9ea399049749e..3a31fe9ed6fc5 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;
 }
 




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux