aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch
new file mode 100644
index 00000000..c4ee4572
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2987-drm-amd-powerplay-fix-memory-allocation-failure-chec.patch
@@ -0,0 +1,42 @@
+From 44b3ce5e8b9a3b2e64892f70cbe8cb3a623f0b21 Mon Sep 17 00:00:00 2001
+From: Evan Quan <evan.quan@amd.com>
+Date: Fri, 12 Jul 2019 10:07:31 +0800
+Subject: [PATCH 2987/4256] drm/amd/powerplay: fix memory allocation failure
+ check V2
+
+Fix memory allocation failure check.
+
+- V2: fix one more similar error
+
+Change-Id: I012b082a7a2b92973a76db8029897fb4a3441694
+Signed-off-by: Evan Quan <evan.quan@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 4 ++--
+ 1 file 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 2a299f708cd7..fd4f2d585bd6 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;
+--
+2.17.1
+