forked from Minki/linux
drm/amd/powerplay: avoid NULL dereference, cz_hwmgr.c
if (a == NULL || a->b == NULL) leads to a NULL pointer dereference if a == NULL. Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
d36f3e048e
commit
bb1800caf7
@ -1218,7 +1218,7 @@ static int cz_hwmgr_backend_init(struct pp_hwmgr *hwmgr)
|
||||
|
||||
static int cz_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
|
||||
{
|
||||
if (hwmgr != NULL || hwmgr->backend != NULL) {
|
||||
if (hwmgr != NULL && hwmgr->backend != NULL) {
|
||||
kfree(hwmgr->backend);
|
||||
kfree(hwmgr);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user