summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tests
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2022-12-01 12:07:36 +0300
committerMaxime Ripard <maxime@cerno.tech>2022-12-01 13:13:24 +0300
commite640e7cc53ea237388759c5d45c7b28503f5c133 (patch)
tree6db5058cfd04d29947dcdac6b3e169ca01e3c96b /drivers/gpu/drm/tests
parent0f9aa074c92dd9274b811c1c3fa93736814a4b0d (diff)
downloadlinux-e640e7cc53ea237388759c5d45c7b28503f5c133.tar.xz
drm/tests: probe_helper: Fix uninitialized variable
The len variable is used while uninitialized. Initialize it. Fixes: 1e4a91db109f ("drm/probe-helper: Provide a TV get_modes helper") Reported-by: kernel test robot <lkp@intel.com> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://lore.kernel.org/r/20221201090736.290935-1-maxime@cerno.tech Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Diffstat (limited to 'drivers/gpu/drm/tests')
-rw-r--r--drivers/gpu/drm/tests/drm_probe_helper_test.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tests/drm_probe_helper_test.c b/drivers/gpu/drm/tests/drm_probe_helper_test.c
index 7e938258c742..211131405500 100644
--- a/drivers/gpu/drm/tests/drm_probe_helper_test.c
+++ b/drivers/gpu/drm/tests/drm_probe_helper_test.c
@@ -115,6 +115,7 @@ drm_test_connector_helper_tv_get_modes_check(struct kunit *test)
ret = drm_connector_helper_tv_get_modes(connector);
KUNIT_EXPECT_EQ(test, ret, params->num_expected_modes);
+ len = 0;
list_for_each_entry(mode, &connector->probed_modes, head)
len++;
KUNIT_EXPECT_EQ(test, len, params->num_expected_modes);