projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
23119de
)
greybus: battery: fix panic on operation error
author
Perry Hung
<perry@leaflabs.com>
Fri, 24 Jul 2015 23:02:29 +0000
(19:02 -0400)
committer
Greg Kroah-Hartman
<gregkh@google.com>
Fri, 24 Jul 2015 23:39:58 +0000
(16:39 -0700)
If an operation times out or otherwise returns an error, val->intval
should not be set and an error-code should be returned.
Fixes a panic on unload while receiving -ENOTCONN.
Signed-off-by: Perry Hung <perry@leaflabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/battery.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/staging/greybus/battery.c
b/drivers/staging/greybus/battery.c
index aad1749752586aea016110739fb0afa86bee8299..e66623966dc92fa232d34372b0b7806a811804d7 100644
(file)
--- a/
drivers/staging/greybus/battery.c
+++ b/
drivers/staging/greybus/battery.c
@@
-281,7
+281,7
@@
static int get_property(struct power_supply *b,
return -EINVAL;
}
- return 0;
+ return
(val->intval < 0) ? val->intval :
0;
}
// FIXME - verify this list, odds are some can be removed and others added.