All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] drm/amd/display: Fix sizeof arguments in bw_calcs_init()
@ 2021-03-22 12:50 ` Gustavo A. R. Silva
  0 siblings, 0 replies; 9+ 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: Gustavo A. R. Silva, dri-devel, amd-gfx, linux-kernel

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://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-03-22 16:03 UTC | newest]

Thread overview: 9+ 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 12:50 ` Gustavo A. R. Silva
2021-03-22 12:50 ` Gustavo A. R. Silva
2021-03-22 14:04 ` Chen, Guchun
2021-03-22 14:04   ` Chen, Guchun
2021-03-22 14:04   ` Chen, Guchun
2021-03-22 13:07   ` Gustavo A. R. Silva
2021-03-22 13:07     ` Gustavo A. R. Silva
2021-03-22 13:07     ` Gustavo A. R. Silva

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.