drm/amd/pp: silence a static checker warning
Subsystems (3)
PATCH 1/1 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.
drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +4 -4
@@ -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 ; }
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · Dan Carpenter
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.
Signed-off-by Dan Carpenter <[email protected]>
Quoted 23 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +4
-4@@ -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 ; }
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
rezhu
AppliedApplied. Thanks.
Best Regards
Rex
Quoted 30 lines · Huang Rui
Quoted 5 lines · Dan Carpenter
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.
Signed-off-by Dan Carpenter <[email protected]>Reviewed-by Huang Rui <[email protected]>Quoted 22 lines
drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c +4
-4@@ -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 ; }
Quoted 4 lines
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx