summaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorInsu Yun <wuninsu@gmail.com>2015-10-19 18:42:21 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2015-10-23 08:32:01 +0200
commitec7aa963bf81803b70b7da71bf79943ae5b9c531 (patch)
tree3da4fe8a8847d00a9b418f67add5967e0070ee75 /drivers/input
parentInput: hp_sdc_rtc - fix y2038 problem in proc_show (diff)
downloadlinux-ec7aa963bf81803b70b7da71bf79943ae5b9c531.tar.xz
linux-ec7aa963bf81803b70b7da71bf79943ae5b9c531.zip
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>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/misc/xen-kbdfront.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c
index 23d0549539d4..0a9ad2cfb55c 100644
--- a/drivers/input/misc/xen-kbdfront.c
+++ b/drivers/input/misc/xen-kbdfront.c
@@ -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();