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: Insu Yun <wuninsu@gmail.com>
Reviewed-by: Julien Grall <julien.grall@citrix.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
Insu Yun 2015-10-19 09:42:21 -07:00 committed by Dmitry Torokhov
parent ba564e7897
commit ec7aa963bf

View File

@ -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();