Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e619e850 authored by Perry Hung's avatar Perry Hung Committed by Greg Kroah-Hartman
Browse files

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: default avatarPerry Hung <perry@leaflabs.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 23119de4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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.