Skip to content

Commit e3f4b64

Browse files
niharcygregkh
authored andcommitted
staging: gpib: lpvo_usb: Return error value from gpib_register_driver()
The function gpib_register_driver() can fail and does not return an error value if it fails. Return the error value if gpib_register_driver() fails. Add pr_err() statement indicating the fail and error value. Signed-off-by: Nihar Chaithanya <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26098b7 commit e3f4b64

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,11 @@ static int usb_gpib_init_module(struct usb_interface *interface)
11791179
return rv;
11801180

11811181
if (!assigned_usb_minors) {
1182-
gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
1182+
rv = gpib_register_driver(&usb_gpib_interface, THIS_MODULE);
1183+
if (rv) {
1184+
pr_err("lpvo_usb_gpib: gpib_register_driver failed: error = %d\n", rv);
1185+
goto exit;
1186+
}
11831187
} else {
11841188
/* check if minor is already registered - maybe useless, but if
11851189
* it happens the code is inconsistent somewhere

0 commit comments

Comments
 (0)