Thread (776 messages) 776 messages, 1 author, 2021-03-02
STALE1926d REVIEWED: 1 (0M)

[PATCH 5.11 302/775] Input: da7280 - fix missing error test

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2021-03-01 23:22:53
Also in: lkml
Subsystem: dialog semiconductor drivers, input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Support Opensource, Dmitry Torokhov, Linus Torvalds

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

[ Upstream commit 1e2020aa0da00051d94c4690c023c45d8f3834bd ]

An "if" testing for error condition has accidentally been dropped from
the code.

Reported-by: kernel test robot <redacted>
Fixes: cd3f609823a5 ("Input: new da7280 haptic driver")
Reviewed-by: Roy Im <redacted>
Link: https://lore.kernel.org/r/X9j8lGFgijzHyYZZ@google.com (local)
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/input/misc/da7280.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index 37568b00873d4..2f698a8c1d650 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -863,6 +863,7 @@ static void da7280_parse_properties(struct device *dev,
 		gpi_str3[7] = '0' + i;
 		haptics->gpi_ctl[i].polarity = 0;
 		error = device_property_read_string(dev, gpi_str3, &str);
+		if (!error)
 			haptics->gpi_ctl[i].polarity =
 				da7280_haptic_of_gpi_pol_str(dev, str);
 	}
-- 
2.27.0


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help