Input: cyttsp - check return value of input_mt_init_slots
authorOreste Salerno <oreste.salerno@tomtom.com>
Wed, 27 Jan 2016 21:55:20 +0000 (13:55 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 27 Jan 2016 22:32:47 +0000 (14:32 -0800)
Signed-off-by: Oreste Salerno <oreste.salerno@tomtom.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/cyttsp_core.c

index 2d699808b55ac6bded63cbfa1b8818e44d97bf53..b6653aa0610872d323b3c9e975041387f39bd678 100644 (file)
@@ -597,7 +597,11 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops,
        input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR,
                             0, CY_MAXZ, 0, 0);
 
-       input_mt_init_slots(input_dev, CY_MAX_ID, 0);
+       error = input_mt_init_slots(input_dev, CY_MAX_ID, 0);
+       if (error) {
+               dev_err(dev, "Unable to init MT slots.\n");
+               return ERR_PTR(error);
+       }
 
        error = devm_request_threaded_irq(dev, ts->irq, NULL, cyttsp_irq,
                                          IRQF_TRIGGER_FALLING | IRQF_ONESHOT,