]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/pp: initialize result to before or'ing in data
authorColin Ian King <colin.king@canonical.com>
Wed, 6 Jun 2018 12:18:31 +0000 (13:18 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Jun 2018 18:45:22 +0000 (13:45 -0500)
commiteee48b5d57033471968fefda7ef7498becfeee69
tree096607cd20a37096fa2c42cdfaec6427f1b0aeec
parent118b0975ff6d04c32307050a4d2addcf5a02e6ef
drm/amd/pp: initialize result to before or'ing in data

The current use of result is or'ing in values and checking for
a non-zero result, however, result is not initialized to zero
so it potentially contains garbage to start with. Fix this by
initializing it to the first return from the call to
vega10_program_didt_config_registers.

Detected by cppcheck:
"(error) Uninitialized variable: result"

Fixes: eba7cd247d25 ("drm/amd/powerplay: added didt support for vega10")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Acked-by: Huang Rui <ray.huang@amd.com>
[Fix the subject as Colin's comment]
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c