From: Dan Carpenter Date: Mon, 4 Jan 2016 20:42:55 +0000 (+0300) Subject: drm/amd/powerplay: fix a reversed condition X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2500a3c9e06d349defdca00f2efd7fab189ae72f;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/amd/powerplay: fix a reversed condition This test was reversed so it would end up leading to a NULL dereference. Fixes: 4630f0faae80 ('drm/amd/powerplay: add Carrizo smu support') Signed-off-by: Dan Carpenter Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c index e74023bd4e0d..873a8d264d5c 100644 --- a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c +++ b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c @@ -818,7 +818,7 @@ static int cz_smu_fini(struct pp_smumgr *smumgr) return -EINVAL; cz_smu = (struct cz_smumgr *)smumgr->backend; - if (!cz_smu) { + if (cz_smu) { cgs_free_gpu_mem(smumgr->device, cz_smu->toc_buffer.handle); cgs_free_gpu_mem(smumgr->device,