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:
Родитель
ba564e7897
Коммит
ec7aa963bf
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче