drm/amd/powerplay: fix memory allocation failure check
Subsystems (2)
PATCH 1/1 drm/amd/powerplay: fix memory allocation failure check
Fix memory allocation failure check.
--- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
@@ -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 ;
Signature · 6 lines
2.21.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
Wang, Kevin(Yang)
Reviewed-byBest Regards,
Kevin
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Evan Quan <[email protected]>
Sent: Friday, July 12, 2019 10:34:46 AM
To: [email protected]
Cc: Quan, Evan
Subject: [PATCH] drm/amd/powerplay: fix memory allocation failure check
Fix memory allocation failure check.
--- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/vega20_ppt.c +1 -1
@@ -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 ;
--
2.21.0
_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx