[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH v2 RESEND] 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@xxxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>
---
v2: For consistency with other code don't consider zero an error
    (utilizing that xenbus_scanf() at present won't return zero).
    Adjust commit message accordingly.
---
 drivers/xen/manage.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 4.10-rc6/drivers/xen/manage.c
+++ 4.10-rc6-xen-manage-xenbus_scanf/drivers/xen/manage.c
@@ -277,7 +277,7 @@ static void sysrq_handler(struct xenbus_
        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;




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.