diff options
author | Jan Beulich <JBeulich@suse.com> | 2017-10-07 22:37:47 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-11-08 10:06:30 +0100 |
commit | fff544c8cf6848c0ac1293d0f2e2b64629a64604 (patch) | |
tree | 849e7a08a5df0e2dd28e211d72ccd2ca6150a5d8 /drivers/xen/manage.c | |
parent | 762d0762b9bb055962526c5fdd71a28d371c3df3 (diff) | |
download | linux-stable-fff544c8cf6848c0ac1293d0f2e2b64629a64604.tar.gz linux-stable-fff544c8cf6848c0ac1293d0f2e2b64629a64604.tar.bz2 linux-stable-fff544c8cf6848c0ac1293d0f2e2b64629a64604.zip |
xen/manage: correct return value check on xenbus_scanf()
[ Upstream commit 4fed1b125eb6252bde478665fc05d4819f774fa8 ]
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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 e12bd3635f83..e8850b0e3272 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c @@ -275,7 +275,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; |