From 7884ae482187ed79bde3bc0cd28bb22b2b7dfe6a Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Fri, 14 Jun 2013 14:23:31 -0700 Subject: Fix some stupidness in ectool's comm_init() handling ectool was checking for negative return values on comm_init(). It should have been checking for nonzero. Or comm_init should have been returning negative. Whatever. The ectool utility was supposed to be a quick-n-dirty debugging tool, so it's not very well tested. BUG=chromium:249218 BRANCH=none TEST=manual Fired up VM instance, tried old version and new version. Old version coredumps, new version doesn't. Change-Id: I0e27d78eead562a16ff826fb80de9e6b07476e12 Signed-off-by: Bill Richardson Reviewed-on: https://gerrit.chromium.org/gerrit/58712 Reviewed-by: Randall Spangler --- util/ectool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/ectool.c b/util/ectool.c index 521ebea767..94a5f3d4ef 100644 --- a/util/ectool.c +++ b/util/ectool.c @@ -3096,7 +3096,7 @@ int main(int argc, char *argv[]) exit(1); } - if (comm_init() < 0) { + if (comm_init()) { fprintf(stderr, "Couldn't find EC\n"); goto out; } -- cgit v1.2.1