Skip to contentSkip to conversation

Input: sx8654 - fix memory allocation check

PATCH In review Dmitry Torokhov 2 participants 2 messages May 8, 2015 – May 11, 2015

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 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).

---
 drivers/input/touchscreen/sx8654.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/sx8654.c +1 -1
index aecb9ad..642f4a5 100644
@@ -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";
Signature · 5 lines
2.2.0.rc0.207.ga3a616c


-- 
Dmitry
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 24 lines · Dmitry Torokhov

We have been testing wrong variable when trying to make sure that input allocation succeeded.

Reported by Coverity (CID 1295918).

---
 drivers/input/touchscreen/sx8654.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/touchscreen/sx8654.c +1 -1
index aecb9ad..642f4a5 100644
@@ -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";
Signature · 6 lines
Sébastien Szymanski
Software Engineer
Armadeus Systems - A new vision of the embedded world
[email protected]
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26