Re: [PATCH] drm/amd/powerplay: fix memory allocation failure check V2
On Fri, Jul 12, 2019 at 1:22 AM Evan Quan wrote: > > Fix memory allocation failure check. > > - V2: fix one more similar error > > Change-Id: I012b082a7a2b92973a76db8029897fb4a3441694 > Signed-off-by: Evan Quan Reviewed-by: Alex Deucher > --- > 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 1fc367307ac0..c826e65430b6 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.21.0 > > ___ > amd-gfx mailing list > amd-gfx@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
RE: [PATCH] drm/amd/powerplay: fix memory allocation failure check V2
Ping.. > -Original Message- > From: Evan Quan > Sent: Friday, July 12, 2019 1:23 PM > To: amd-gfx@lists.freedesktop.org > Cc: Quan, Evan > Subject: [PATCH] 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 > --- > 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 1fc367307ac0..c826e65430b6 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.21.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] 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 --- 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 1fc367307ac0..c826e65430b6 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.21.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amd/powerplay: fix memory allocation failure check
Reviewed-by: Kevin Wang Best Regards, Kevin From: amd-gfx on behalf of Evan Quan Sent: Friday, July 12, 2019 10:34:46 AM To: amd-gfx@lists.freedesktop.org Cc: Quan, Evan Subject: [PATCH] drm/amd/powerplay: fix memory allocation failure check Fix memory allocation failure check. Change-Id: I012b082a7a2b92973a76db8029897fb4a3441694 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index 1fc367307ac0..9e3e737926aa 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; -- 2.21.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] drm/amd/powerplay: fix memory allocation failure check
Fix memory allocation failure check. Change-Id: I012b082a7a2b92973a76db8029897fb4a3441694 Signed-off-by: Evan Quan --- drivers/gpu/drm/amd/powerplay/vega20_ppt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/powerplay/vega20_ppt.c b/drivers/gpu/drm/amd/powerplay/vega20_ppt.c index 1fc367307ac0..9e3e737926aa 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; -- 2.21.0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx