projects
/
platform
/
kernel
/
linux-rpi3.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
fd40cda
..
2b80326
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);