diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-12-10 17:32:05 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-12-10 17:35:24 +0300 |
commit | 1805ec67b12a12c794aee7ed46bd577748ee2a2c (patch) | |
tree | 1c52fe04ae2384a5f354f522b6cff58394cb39dd /drivers/gpu/drm/i915/gt/selftest_engine_cs.c | |
parent | 82c69bf58650e644c61aa2bf5100b63a1070fd2f (diff) | |
download | linux-1805ec67b12a12c794aee7ed46bd577748ee2a2c.tar.xz |
drm/i915/selftests: fix uninitialized variable sum when summing up values
Currently the variable sum is not uninitialized and hence will cause an
incorrect result in the summation values. Fix this by initializing
sum to the first item in the summation.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 3c7a44bbbfa7 ("drm/i915/selftests: Perform some basic cycle counting of MI ops")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210143205.338308-1-colin.king@canonical.com
Diffstat (limited to 'drivers/gpu/drm/i915/gt/selftest_engine_cs.c')
-rw-r--r-- | drivers/gpu/drm/i915/gt/selftest_engine_cs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_cs.c b/drivers/gpu/drm/i915/gt/selftest_engine_cs.c index 761d81f4bd68..f88e445a1cae 100644 --- a/drivers/gpu/drm/i915/gt/selftest_engine_cs.c +++ b/drivers/gpu/drm/i915/gt/selftest_engine_cs.c @@ -108,7 +108,7 @@ static u32 trifilter(u32 *a) sort(a, COUNT, sizeof(*a), cmp_u32, NULL); - sum += mul_u32_u32(a[2], 2); + sum = mul_u32_u32(a[2], 2); sum += a[1]; sum += a[3]; |