summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2016-01-06 16:48:38 +0800
committerAlex Deucher <alexander.deucher@amd.com>2016-01-08 15:39:23 -0500
commitc15c8d70207d467bb4312d6ac5536c101246fdc6 (patch)
tree140ef07a32acc7e2590ad28b7e716ead3b1b595e /drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
parent75ac63dbc3b0f4d3af67a5857790749e954e2ba6 (diff)
downloadlinux-c15c8d70207d467bb4312d6ac5536c101246fdc6.tar.gz
linux-c15c8d70207d467bb4312d6ac5536c101246fdc6.tar.xz
drm/amd/powerplay: fix Smatch static checker warnings
1. return -1 instead of -ENOMEM 2. The struct type mismatch warnings. 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> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
index ca4554b402f9..5fb98aa2e719 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hwmgr.c
@@ -111,6 +111,9 @@ int hw_init_power_state_table(struct pp_hwmgr *hwmgr)
hwmgr->ps = kzalloc(size * table_entries, GFP_KERNEL);
+ if (hwmgr->ps == NULL)
+ return -ENOMEM;
+
state = hwmgr->ps;
for (i = 0; i < table_entries; i++) {