* [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()
@ 2021-03-22 12:50 Gustavo A. R. Silva
2021-03-22 14:04 ` Chen, Guchun
0 siblings, 1 reply; 3+ messages in thread
From: Gustavo A. R. Silva @ 2021-03-22 12:50 UTC (permalink / raw)
To: Lee Jones, Harry Wentland, Leo Li, Alex Deucher,
Christian König, David Airlie, Daniel Vetter
Cc: amd-gfx, dri-devel, linux-kernel, Gustavo A. R. Silva
The wrong sizeof values are currently being used as arguments to
kzalloc().
Fix this by using the right arguments *dceip and *vbios,
correspondingly.
Addresses-Coverity-ID: 1502901 ("Wrong sizeof argument")
Fixes: fca1e079055e ("drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index 556ecfabc8d2..1244fcb0f446 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -2051,11 +2051,11 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id);
- dceip = kzalloc(sizeof(dceip), GFP_KERNEL);
+ dceip = kzalloc(sizeof(*dceip), GFP_KERNEL);
if (!dceip)
return;
- vbios = kzalloc(sizeof(vbios), GFP_KERNEL);
+ vbios = kzalloc(sizeof(*vbios), GFP_KERNEL);
if (!vbios) {
kfree(dceip);
return;
--
2.27.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()
2021-03-22 14:04 ` Chen, Guchun
@ 2021-03-22 13:07 ` Gustavo A. R. Silva
0 siblings, 0 replies; 3+ messages in thread
From: Gustavo A. R. Silva @ 2021-03-22 13:07 UTC (permalink / raw)
To: Chen, Guchun, Gustavo A. R. Silva, Lee Jones, Wentland, Harry,
Li, Sun peng (Leo),
Deucher, Alexander, Koenig, Christian, David Airlie,
Daniel Vetter
Cc: dri-devel, amd-gfx, linux-kernel
On 3/22/21 09:04, Chen, Guchun wrote:
> [AMD Public Use]
>
> Thanks for your patch, Silva. The issue has been fixed by " a5c6007e20e1 drm/amd/display: fix modprobe failure on vega series".
Great. :)
Good to know this is already fixed.
Thanks!
--
Gustavo
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()
2021-03-22 12:50 [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init() Gustavo A. R. Silva
@ 2021-03-22 14:04 ` Chen, Guchun
2021-03-22 13:07 ` Gustavo A. R. Silva
0 siblings, 1 reply; 3+ messages in thread
From: Chen, Guchun @ 2021-03-22 14:04 UTC (permalink / raw)
To: Gustavo A. R. Silva, Lee Jones, Wentland, Harry, Li,
Sun peng (Leo),
Deucher, Alexander, Koenig, Christian, David Airlie,
Daniel Vetter
Cc: dri-devel, amd-gfx, linux-kernel
[AMD Public Use]
Thanks for your patch, Silva. The issue has been fixed by " a5c6007e20e1 drm/amd/display: fix modprobe failure on vega series".
Regards,
Guchun
-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Gustavo A. R. Silva
Sent: Monday, March 22, 2021 8:51 PM
To: Lee Jones <lee.jones@linaro.org>; Wentland, Harry <Harry.Wentland@amd.com>; Li, Sun peng (Leo) <Sunpeng.Li@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Koenig, Christian <Christian.Koenig@amd.com>; David Airlie <airlied@linux.ie>; Daniel Vetter <daniel@ffwll.ch>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>; dri-devel@lists.freedesktop.org; amd-gfx@lists.freedesktop.org; linux-kernel@vger.kernel.org
Subject: [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()
The wrong sizeof values are currently being used as arguments to kzalloc().
Fix this by using the right arguments *dceip and *vbios, correspondingly.
Addresses-Coverity-ID: 1502901 ("Wrong sizeof argument")
Fixes: fca1e079055e ("drm/amd/display/dc/calcs/dce_calcs: Remove some large variables from the stack")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index 556ecfabc8d2..1244fcb0f446 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -2051,11 +2051,11 @@ void bw_calcs_init(struct bw_calcs_dceip *bw_dceip,
enum bw_calcs_version version = bw_calcs_version_from_asic_id(asic_id);
- dceip = kzalloc(sizeof(dceip), GFP_KERNEL);
+ dceip = kzalloc(sizeof(*dceip), GFP_KERNEL);
if (!dceip)
return;
- vbios = kzalloc(sizeof(vbios), GFP_KERNEL);
+ vbios = kzalloc(sizeof(*vbios), GFP_KERNEL);
if (!vbios) {
kfree(dceip);
return;
--
2.27.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cguchun.chen%40amd.com%7C4ec6ae20f70a488fd2dd08d8ed3987cd%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520178643844637%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YKVR3n%2FnX50dwuP91T1xPxW%2FvgisWDY0dvF8PxO4P4A%3D&reserved=0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-22 14:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 12:50 [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init() Gustavo A. R. Silva
2021-03-22 14:04 ` Chen, Guchun
2021-03-22 13:07 ` Gustavo A. R. Silva
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).