mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] drm/amd/display: move from kzalloc(size * nr, ...) to kcalloc(nr, size, ...)
@ 2025-02-27 23:16 Ethan Carter Edwards
  2025-02-27 23:16 ` [PATCH 1/4] drm/amd/display: change kzalloc to kcalloc in dcn30_validate_bandwidth() Ethan Carter Edwards
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ethan Carter Edwards @ 2025-02-27 23:16 UTC (permalink / raw)
  To: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Christian König, David Airlie, Simona Vetter
  Cc: amd-gfx, dri-devel, linux-kernel, linux-hardening, Ethan Carter Edwards

We are trying to get rid of all multiplications from allocation
functions to prevent integer overflows. Here the multiplications are
probably safe, but using kcalloc() is more appropriate and improves
readability. It is also safer. This series contains a few patches
with these fixes.

Part of the Kernel Self Protection Project efforts. Links below have
more details.

Link: https://github.com/KSPP/linux/issues/162
Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
---
Ethan Carter Edwards (4):
      drm/amd/display: change kzalloc to kcalloc in dcn30_validate_bandwidth()
      drm/amd/display: change kzalloc to kcalloc in dcn31_validate_bandwidth()
      drm/amd/display: change kzalloc to kcalloc in dcn314_validate_bandwidth()
      drm/amd/display: change kzalloc to kcalloc in dml1_validate()

 drivers/gpu/drm/amd/display/dc/resource/dcn30/dcn30_resource.c   | 3 ++-
 drivers/gpu/drm/amd/display/dc/resource/dcn31/dcn31_resource.c   | 3 ++-
 drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c | 3 ++-
 drivers/gpu/drm/amd/display/dc/resource/dcn32/dcn32_resource.c   | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)
---
base-commit: be5c7bbb3a64baf884481a1ba0c2f8fb2f93f7c3
change-id: 20250227-amd-display-a8342c55a9a0

Best regards,
-- 
Ethan Carter Edwards <ethan@ethancedwards.com>


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

end of thread, other threads:[~2025-03-06 21:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-27 23:16 [PATCH 0/4] drm/amd/display: move from kzalloc(size * nr, ...) to kcalloc(nr, size, ...) Ethan Carter Edwards
2025-02-27 23:16 ` [PATCH 1/4] drm/amd/display: change kzalloc to kcalloc in dcn30_validate_bandwidth() Ethan Carter Edwards
2025-02-27 23:16 ` [PATCH 2/4] drm/amd/display: change kzalloc to kcalloc in dcn31_validate_bandwidth() Ethan Carter Edwards
2025-02-27 23:16 ` [PATCH 3/4] drm/amd/display: change kzalloc to kcalloc in dcn314_validate_bandwidth() Ethan Carter Edwards
2025-02-27 23:16 ` [PATCH 4/4] drm/amd/display: change kzalloc to kcalloc in dml1_validate() Ethan Carter Edwards
2025-03-04 18:12 ` [PATCH 0/4] drm/amd/display: move from kzalloc(size * nr, ...) to kcalloc(nr, size, ...) Rodrigo Siqueira
2025-03-06 21:24 ` Alex Hung

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®