diff options
author | Evan Quan <evan.quan@amd.com> | 2019-07-12 04:07:31 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-07-17 20:34:30 +0200 |
commit | 366cf03ec00f18e802f304c2cc057cac842e1244 (patch) | |
tree | b3b417a03efce43f299a943abfaaf8cdff2e06f7 /drivers/gpu/drm/amd/powerplay | |
parent | drm/amdgpu: Fix silent amdgpu_bo_move failures (diff) | |
download | linux-366cf03ec00f18e802f304c2cc057cac842e1244.tar.xz linux-366cf03ec00f18e802f304c2cc057cac842e1244.zip |
drm/amd/powerplay: fix memory allocation failure check V2
Fix memory allocation failure check.
- V2: fix one more similar error
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index 9204e4e50d09..3c605257b89c 100644 --- a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c +++ b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c @@ -319,7 +319,7 @@ static int vega20_tables_init(struct smu_context *smu, struct smu_table *tables) AMDGPU_GEM_DOMAIN_VRAM); smu_table->metrics_table = kzalloc(sizeof(SmuMetrics_t), GFP_KERNEL); - if (smu_table->metrics_table) + if (!smu_table->metrics_table) return -ENOMEM; smu_table->metrics_time = 0; @@ -1502,7 +1502,7 @@ static int vega20_set_default_od8_setttings(struct smu_context *smu) od8_settings = kzalloc(sizeof(struct vega20_od8_settings), GFP_KERNEL); - if (od8_settings) + if (!od8_settings) return -ENOMEM; smu->od_settings = (void *)od8_settings; |