greybus: vibrator: add missing protocol-register error handling
Add missing error handling when registering the vibrator protocol during module init. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
4505c4d44a
commit
d4efa68803
@ -171,7 +171,16 @@ static __init int protocol_init(void)
|
||||
if (retval)
|
||||
return retval;
|
||||
|
||||
return gb_protocol_register(&vibrator_protocol);
|
||||
retval = gb_protocol_register(&vibrator_protocol);
|
||||
if (retval)
|
||||
goto err_class_unregister;
|
||||
|
||||
return 0;
|
||||
|
||||
err_class_unregister:
|
||||
class_unregister(&vibrator_class);
|
||||
|
||||
return retval;
|
||||
}
|
||||
module_init(protocol_init);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user