]> git.ipfire.org Git - thirdparty/linux.git/commit
staging: gpib: agilent_82357a: Handle gpib_register_driver() errors
authorNihar Chaithanya <niharchaithanya@gmail.com>
Mon, 30 Dec 2024 18:56:23 +0000 (00:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Jan 2025 14:38:55 +0000 (15:38 +0100)
commit9e43ebc613e2adb9b9e900e11a4099e104b61f2d
treec4abb7355b560fe7c4bb7edf0d5d6b9006896c19
parentf546fa464031423be3dbebc966ad4703f985c9d5
staging: gpib: agilent_82357a: Handle gpib_register_driver() errors

The usb_register() function can fail and returns an error value which
is not returned. The function gpib_register_driver() can also fail
which can result in semi-registered module.

In case gpib_register_driver() fails unregister the previous usb driver
registering function. Return the error value if gpib_register_driver()
or usb_register() functions fail. Add pr_err when registering driver
fails also indicating the error value.

Signed-off-by: Nihar Chaithanya <niharchaithanya@gmail.com>
Link: https://lore.kernel.org/r/20241230185633.175690-4-niharchaithanya@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/gpib/agilent_82357a/agilent_82357a.c