Skip to content

Commit

Permalink
drm/amd/pp: silence a static checker warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Huang Rui <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
  • Loading branch information
Dan Carpenter authored and alexdeucher committed Apr 3, 2018
1 parent 687c1c2 commit 326a59e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,13 @@ static int smu8_get_system_info_data(struct pp_hwmgr *hwmgr)
GetIndexIntoMasterTable(DATA, IntegratedSystemInfo),
&size, &frev, &crev);

if (crev != 9) {
pr_err("Unsupported IGP table: %d %d\n", frev, crev);
if (info == NULL) {
pr_err("Could not retrieve the Integrated System Info Table!\n");
return -EINVAL;
}

if (info == NULL) {
pr_err("Could not retrieve the Integrated System Info Table!\n");
if (crev != 9) {
pr_err("Unsupported IGP table: %d %d\n", frev, crev);
return -EINVAL;
}

Expand Down

0 comments on commit 326a59e

Please sign in to comment.