aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amdfalconx86/recipes-kernel/linux/linux-yocto/1013-drm-amd-powerplay-fix-bug-that-NULL-checks-are-rever.patch
blob: e0f3dff2bc8cd95ee1ea65cc739a8089d0557d16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 8818ae88d7aea893135222317134c61a36e21574 Mon Sep 17 00:00:00 2001
From: Rex Zhu <Rex.Zhu@amd.com>
Date: Wed, 6 Jan 2016 16:22:07 +0800
Subject: [PATCH 1013/1050] drm/amd/powerplay: fix bug that NULL checks are
 reversed.

&& was used instead of ||.

Change-Id: Ie5af3fe96b3062d43b1a5e6c505b84812828d1e4
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ken Wang  <Qingqing.Wang@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
index 248446b..494a6e7 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c
@@ -579,7 +579,7 @@ static int cz_tf_init_sclk_limit(struct pp_hwmgr *hwmgr, void *input,
 					hwmgr->dyn_state.vddc_dependency_on_sclk;
 	unsigned long clock = 0, level;
 
-	if (NULL == table && table->count <= 0)
+	if (NULL == table || table->count <= 0)
 		return -EINVAL;
 
 	cz_hwmgr->sclk_dpm.soft_min_clk = table->entries[0].clk;
@@ -606,7 +606,7 @@ static int cz_tf_init_uvd_limit(struct pp_hwmgr *hwmgr, void *input,
 				hwmgr->dyn_state.uvd_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
 
-	if (NULL == table && table->count <= 0)
+	if (NULL == table || table->count <= 0)
 		return -EINVAL;
 
 	cz_hwmgr->uvd_dpm.soft_min_clk = 0;
@@ -634,7 +634,7 @@ static int cz_tf_init_vce_limit(struct pp_hwmgr *hwmgr, void *input,
 				hwmgr->dyn_state.vce_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
 
-	if (NULL == table && table->count <= 0)
+	if (NULL == table || table->count <= 0)
 		return -EINVAL;
 
 	cz_hwmgr->vce_dpm.soft_min_clk = 0;
@@ -662,7 +662,7 @@ static int cz_tf_init_acp_limit(struct pp_hwmgr *hwmgr, void *input,
 				hwmgr->dyn_state.acp_clock_voltage_dependency_table;
 	unsigned long clock = 0, level;
 
-	if (NULL == table && table->count <= 0)
+	if (NULL == table || table->count <= 0)
 		return -EINVAL;
 
 	cz_hwmgr->acp_dpm.soft_min_clk = 0;
@@ -1188,7 +1188,7 @@ int cz_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr)
 				hwmgr->dyn_state.vddc_dependency_on_sclk;
 	unsigned long clock = 0, level;
 
-	if (NULL == table && table->count <= 0)
+	if (NULL == table || table->count <= 0)
 		return -EINVAL;
 
 	cz_hwmgr->sclk_dpm.soft_min_clk = table->entries[0].clk;
-- 
1.9.1