Input: sx8654 - fix memory allocation check
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 4 May 2015 19:45:38 +0000 (12:45 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 13 May 2015 17:29:33 +0000 (10:29 -0700)
We have been testing wrong variable when trying to make sure that input
allocation succeeded.

Reported by Coverity (CID 1295918).

Acked-by: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/sx8654.c

index aecb9ad2e7016885cda6ee2a7c08af1e461c9980..642f4a53de509f2f240f4cd5279ce2749d235455 100644 (file)
@@ -187,7 +187,7 @@ static int sx8654_probe(struct i2c_client *client,
                return -ENOMEM;
 
        input = devm_input_allocate_device(&client->dev);
-       if (!sx8654)
+       if (!input)
                return -ENOMEM;
 
        input->name = "SX8654 I2C Touchscreen";