[bug report] drm/amd/powerplay: add point check to avoid NULL point hang.

Quan, Evan Evan.Quan at amd.com
Wed Aug 26 03:33:56 UTC 2020


[AMD Official Use Only - Internal Distribution Only]

Thanks. I just sent out a patch to address this.

BR
Evan
-----Original Message-----
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of Dan Carpenter
Sent: Tuesday, August 25, 2020 6:24 PM
To: Rex.Zhu at amd.com
Cc: amd-gfx at lists.freedesktop.org
Subject: [bug report] drm/amd/powerplay: add point check to avoid NULL point hang.

Hello Rex Zhu,

The patch 88b8dcbe21fd: "drm/amd/powerplay: add point check to avoid NULL point hang." from Dec 11, 2015, leads to the following static checker warning:

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c:274 phm_check_smc_update_required_for_display_configuration()
warn: signedness bug returning '(-22)'

drivers/gpu/drm/amd/amdgpu/../pm/powerplay/hwmgr/hardwaremanager.c
   272  bool phm_check_smc_update_required_for_display_configuration(struct pp_hwmgr *hwmgr)
   273  {
   274          PHM_FUNC_CHECK(hwmgr);

PHM_FUNC_CHECK() has a hiddren -EINVAL return that becomes true when casted to bool.

   275          if (hwmgr->pp_one_vf)
   276                  return false;
   277
   278          if (hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration == NULL)
   279                  return false;
   280
   281          return hwmgr->hwmgr_func->check_smc_update_required_for_display_configuration(hwmgr);
   282  }

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7Cd3cadb4b92e04c5d4eae08d848e111a0%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637339478834526298&sdata=236vygLQdbMVXk6XBDaayrTw2qODhcmTCFvtl0%2B95IM%3D&reserved=0


More information about the amd-gfx mailing list