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

The error value from the init_ni_gpib_cs() function is not
returned and the previous registering functions are not unregistered.

The function gpib_register_driver() can fail and similar to
pcmcia_register_driver() function failing, the previous registering
functions are not unregistered.

Unregister the gpib and pci register functions if the subsequent
gpib or pcmcia register functions fail and return the error value. Add
pr_err() statements indicating the fail and the error value.

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