greybus: battery: fix panic on operation error

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>
This commit is contained in:
Perry Hung 2015-07-24 19:02:29 -04:00 • committed by Greg Kroah-Hartman
commit e619e8505b