浏览代码

Input: sx8654 - fix memory allocation check

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>
Dmitry Torokhov 10 年之前
父节点
当前提交
22ffc3e42a
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/input/touchscreen/sx8654.c

+ 1 - 1
drivers/input/touchscreen/sx8654.c

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