projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4505c4d
)
greybus: vibrator: add missing protocol-register error handling
author
Johan Hovold
<johan@hovoldconsulting.com>
Tue, 13 Oct 2015 17:10:27 +0000
(19:10 +0200)
committer
Greg Kroah-Hartman
<gregkh@google.com>
Wed, 14 Oct 2015 19:08:50 +0000
(12:08 -0700)
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>
drivers/staging/greybus/vibrator.c
patch
|
blob
|
history
diff --git
a/drivers/staging/greybus/vibrator.c
b/drivers/staging/greybus/vibrator.c
index fd40cda565e48c73abbcb0a47e1c224285012237..2b8032653f556ab925638d5ead4c8cd53b51a5e4 100644
(file)
--- a/
drivers/staging/greybus/vibrator.c
+++ b/
drivers/staging/greybus/vibrator.c
@@
-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);