mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-25 19:07:46 +00:00
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:
parent
ba564e7897
commit
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();
|
||||
|
Loading…
Reference in New Issue
Block a user