Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec7aa963 authored by Insu Yun's avatar Insu Yun Committed by Dmitry Torokhov
Browse files

Input: xen - check return value of xenbus_printf



Internally, xenbus_printf uses memory allocation, so it can fail under
memory pressure, leaving the input device configured as absolute with the
backend supplying relative coordinates.

Signed-off-by: default avatarInsu Yun <wuninsu@gmail.com>
Reviewed-by: default avatarJulien Grall <julien.grall@citrix.com>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent ba564e78
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -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();