提交 ec7aa963 编写于 作者: I Insu Yun 提交者: Dmitry Torokhov

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: NInsu Yun <wuninsu@gmail.com>
Reviewed-by: NJulien Grall <julien.grall@citrix.com>
Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
上级 ba564e78
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册