diff options
author | Jan Beulich <JBeulich@suse.com> | 2017-02-03 01:54:05 -0700 |
---|---|---|
committer | Boris Ostrovsky <boris.ostrovsky@oracle.com> | 2017-02-03 11:26:40 -0500 |
commit | 4fed1b125eb6252bde478665fc05d4819f774fa8 (patch) | |
tree | b01d18177269f4c15286400ad389564e1846636e /drivers/xen/manage.c | |
parent | cc272163ea554a97dac180fa8dd6cd54c2810bd1 (diff) | |
download | lwn-4fed1b125eb6252bde478665fc05d4819f774fa8.tar.gz lwn-4fed1b125eb6252bde478665fc05d4819f774fa8.zip |
xen/manage: correct return value check on xenbus_scanf()
A negative return value indicates an error; in fact the function at
present won't ever return zero.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Diffstat (limited to 'drivers/xen/manage.c')
-rw-r--r-- | drivers/xen/manage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index 26e5e8507f03..357a8db859c9 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_watch *watch, const char **vec, err = xenbus_transaction_start(&xbt); if (err) return; - if (!xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key)) { + if (xenbus_scanf(xbt, "control", "sysrq", "%c", &sysrq_key) < 0) { pr_err("Unable to read sysrq code in control/sysrq\n"); xenbus_transaction_end(xbt, 1); return; |