[PATCH] xen-kbdfront: correct return value checks on xenbus_scanf()

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

 



Only a positive return value indicates success.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
 drivers/input/misc/xen-kbdfront.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

--- 4.7-rc6-xenbus_scanf.orig/drivers/input/misc/xen-kbdfront.c
+++ 4.7-rc6-xenbus_scanf/drivers/input/misc/xen-kbdfront.c
@@ -127,7 +127,8 @@ static int xenkbd_probe(struct xenbus_de
 	if (!info->page)
 		goto error_nomem;
 
-	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
+	if (xenbus_scanf(XBT_NIL, dev->otherend,
+			 "feature-abs-pointer", "%d", &abs) <= 0)
 		abs = 0;
 	if (abs) {
 		ret = xenbus_printf(XBT_NIL, dev->nodename,
@@ -324,7 +325,7 @@ static void xenkbd_backend_changed(struc
 InitWait:
 		ret = xenbus_scanf(XBT_NIL, info->xbdev->otherend,
 				   "feature-abs-pointer", "%d", &val);
-		if (ret < 0)
+		if (ret <= 0)
 			val = 0;
 		if (val) {
 			ret = xenbus_printf(XBT_NIL, info->xbdev->nodename,



--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux