Skip to contentSkip to conversation

Input: tests - fix input_test_match_device_id test

PATCH In review Dmitry Torokhov 3 participants 3 messages May 3, 2023 – May 4, 2023

Subsystems (2)
lore
Share & tools
lore

Dmitry Torokhov

author maintainer
#0 lore raw

PATCH 1/1 Input: tests - fix input_test_match_device_id test

Properly initialize input_device_id structure in input_test_match_device_id test to make sure it contains no garbage causing the test to randomly fail.

Fixes fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions")
---
 drivers/input/tests/input_test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/tests/input_test.c +1 -1
index 8b8ac3412a70..0540225f0288 100644
@@ -87,7 +87,7 @@ static void input_test_timestamp(struct kunit *test)
 static void input_test_match_device_id(struct kunit *test)
 {
 	struct input_dev *input_dev = test->priv;
-	struct input_device_id id;
+	struct input_device_id id = { 0 };
 
 	/*
 	 * Must match when the input device bus, vendor, product, version
Signature · 5 lines
2.40.1.495.gc816e09b53d-goog


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

Dmitry Torokhov <[email protected]> writes:

Hello Dmitry,

Quoted 8 lines

Properly initialize input_device_id structure in input_test_match_device_id test to make sure it contains no garbage causing the test to randomly fail.

Fixes fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions")

---

Thanks a lot for fixing this!

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat
Tested-by on v1 1/1
#2 lore raw
In reply to Dmitry Torokhov
Quoted 7 lines · Dmitry Torokhov

Properly initialize input_device_id structure in input_test_match_device_id test to make sure it contains no garbage causing the test to randomly fail.

Fixes fdefcbdd6f36 ("Input: Add KUnit tests for some of the input core helper functions")

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds