diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-03-23 07:39:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-04-03 13:52:57 -0400 |
commit | 326a59e78a05e0a4941463d16ea427337d90e0f5 (patch) | |
tree | a918d2dede7a337bafbdedd9e7b8bcb8dd37c55c /drivers | |
parent | 687c1c2eed0c0463b731ed462dd87de6ba7d4ac8 (diff) |
drm/amd/pp: silence a static checker warning
This has a static checker warning because "frev" and "crev" can be
uninitialized if "info" is NULL. I just changed the order of the checks
so that we check "info" first.
Reviewed-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c index 75a465f771f0..7b26607c646a 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c | |||
@@ -319,13 +319,13 @@ static int smu8_get_system_info_data(struct pp_hwmgr *hwmgr) | |||
319 | GetIndexIntoMasterTable(DATA, IntegratedSystemInfo), | 319 | GetIndexIntoMasterTable(DATA, IntegratedSystemInfo), |
320 | &size, &frev, &crev); | 320 | &size, &frev, &crev); |
321 | 321 | ||
322 | if (crev != 9) { | 322 | if (info == NULL) { |
323 | pr_err("Unsupported IGP table: %d %d\n", frev, crev); | 323 | pr_err("Could not retrieve the Integrated System Info Table!\n"); |
324 | return -EINVAL; | 324 | return -EINVAL; |
325 | } | 325 | } |
326 | 326 | ||
327 | if (info == NULL) { | 327 | if (crev != 9) { |
328 | pr_err("Could not retrieve the Integrated System Info Table!\n"); | 328 | pr_err("Unsupported IGP table: %d %d\n", frev, crev); |
329 | return -EINVAL; | 329 | return -EINVAL; |
330 | } | 330 | } |
331 | 331 | ||