Commit d4efa688 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: vibrator: add missing protocol-register error handling

Add missing error handling when registering the vibrator protocol during
module init.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 4505c4d4
...@@ -171,7 +171,16 @@ static __init int protocol_init(void) ...@@ -171,7 +171,16 @@ static __init int protocol_init(void)
if (retval) if (retval)
return 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); module_init(protocol_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment