]> git.ipfire.org Git - thirdparty/linux.git/commit
staging: gpib: ni_usb: Handle gpib_register_driver() errors
authorNihar Chaithanya <niharchaithanya@gmail.com>
Mon, 30 Dec 2024 18:56:33 +0000 (00:26 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 7 Jan 2025 14:38:56 +0000 (15:38 +0100)
commit635ddb8ccdbde0d917b0a7448b0fd9d6cc27a2a9
treeda9c1ee71a3795cfa113972575e10ba24d47250e
parente3f4b64edb242ba59095b57f54df64ccecc67aac
staging: gpib: ni_usb: 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() statements indicating the
fail and error value.

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