public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] drm/amd/powerplay: fix a reversed condition
@ 2016-01-04 20:42 Dan Carpenter
  2016-01-04 21:17 ` Alex Deucher
  2016-01-05  9:06 ` SF Markus Elfring
  0 siblings, 2 replies; 5+ messages in thread
From: Dan Carpenter @ 2016-01-04 20:42 UTC (permalink / raw)
  To: David Airlie, Jammy Zhou
  Cc: Alex Deucher, kernel-janitors, Rex Zhu, dri-devel

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 <dan.carpenter@oracle.com>

diff --git a/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c b/drivers/gpu/drm/amd/powerplay/smumgr/cz_smumgr.c
index e74023b..873a8d2 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,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-05 12:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-04 20:42 [patch] drm/amd/powerplay: fix a reversed condition Dan Carpenter
2016-01-04 21:17 ` Alex Deucher
2016-01-05  9:06 ` SF Markus Elfring
2016-01-05 11:14   ` Dan Carpenter
2016-01-05 12:36     ` SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox