Skip to contentSkip to conversation

xen: check return value of xenbus_printf

PATCH Applied Insu Yun 2 participants 2 messages Oct 19, 2015

Subsystems (2)
lore
Share & tools
lore

Insu Yun

author
#0 lore raw

PATCH 1/1 xen: check return value of xenbus_printf

---
 drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/input/misc/xen-kbdfront.c +8 -2
index 23d0549..0a9ad2cf 100644
@@ -129,8 +129,14 @@ static int xenkbd_probe(struct xenbus_device *dev,
 
 	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
 		abs = 0;
-	if (abs)
-		xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
+	if (abs) {
+		ret = xenbus_printf(XBT_NIL, dev->nodename,
+				    "request-abs-pointer", "1");
+		if (ret) {
+			pr_warning("xenkbd: can't request abs-pointer");
+			abs = 0;
+		}
+	}
 
 	/* keyboard */
 	kbd = input_allocate_device();
Signature · 1 line
1.9.1
maintainer Applied
#1 lore raw
Quoted 1 line · Insu Yun

Applied, thank you. However you still are missing the commit description on this version of the patch; I had to fish it from your original posting.

Thanks.

Quoted 28 lines
---
 drivers/input/misc/xen-kbdfront.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/input/misc/xen-kbdfront.c +8 -2
index 23d0549..0a9ad2cf 100644
@@ -129,8 +129,14 @@ static int xenkbd_probe(struct xenbus_device *dev,
 
 	if (xenbus_scanf(XBT_NIL, dev->otherend, "feature-abs-pointer", "%d", &abs) < 0)
 		abs = 0;
-	if (abs)
-		xenbus_printf(XBT_NIL, dev->nodename, "request-abs-pointer", "1");
+	if (abs) {
+		ret = xenbus_printf(XBT_NIL, dev->nodename,
+				    "request-abs-pointer", "1");
+		if (ret) {
+			pr_warning("xenkbd: can't request abs-pointer");
+			abs = 0;
+		}
+	}
 
 	/* keyboard */
 	kbd = input_allocate_device();
Signature · 1 line
1.9.1
Signature · 1 line
Dmitry