kernel_samsung_a53x/drivers/gpu/drm/radeon
Erick Archer d0cd76074d drm/radeon/radeon_display: Decrease the size of allocated memory
[ Upstream commit ae6a233092747e9652eb793d92f79d0820e01c6a ]

This is an effort to get rid of all multiplications from allocation
functions in order to prevent integer overflows [1] [2].

In this case, the memory allocated to store RADEONFB_CONN_LIMIT pointers
to "drm_connector" structures can be avoided. This is because this
memory area is never accessed.

Also, in the kzalloc function, it is preferred to use sizeof(*pointer)
instead of sizeof(type) due to the type of the variable can change and
one needs not change the former (unlike the latter).

At the same time take advantage to remove the "#if 0" block, the code
where the removed memory area was accessed, and the RADEONFB_CONN_LIMIT
constant due to now is never used.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1]
Link: https://github.com/KSPP/linux/issues/160 [2]
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Erick Archer <erick.archer@outlook.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-19 14:19:32 +01:00
..
reg_srcs Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atom-bits.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atom-names.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atom-types.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atom.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atom.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atombios.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atombios_crtc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atombios_dp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atombios_encoders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
atombios_i2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
avivod.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btc_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btc_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
btcd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cayman_blit_shaders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cayman_blit_shaders.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ci_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ci_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ci_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cik.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cik_blit_shaders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cik_blit_shaders.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cik_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cik_sdma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cikd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clearstate_cayman.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clearstate_ci.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clearstate_defs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clearstate_evergreen.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
clearstate_si.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cypress_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cypress_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce3_1_afmt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
dce6_afmt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen.c drm/radeon: possible buffer overflow 2024-11-18 11:42:55 +01:00
evergreen_blit_shaders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_blit_shaders.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_hdmi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreen_smc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
evergreend.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kv_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kv_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kv_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mkregtable.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni.c drm/radeon/ni: Fix wrong firmware size logging in ni_init_microcode() 2024-11-19 08:44:53 +01:00
ni_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ni_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
nislands_smc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ObjectID.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ppsmc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
pptable.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r100.c drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check() 2024-11-18 12:12:39 +01:00
r100_track.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r100d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r200.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r300.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r300_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r300d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r420.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r420d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r500_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r520.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r520d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_blit_shaders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_blit_shaders.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_cs.c drm/radeon/r600_cs: Fix possible int overflows in r600_cs_check_reg() 2024-11-18 12:12:39 +01:00
r600_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_hdmi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
r600d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon.h drm/radeon/radeon_display: Decrease the size of allocated memory 2024-11-19 14:19:32 +01:00
radeon_acpi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_acpi.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_agp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_asic.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_asic.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_atombios.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_atpx_handler.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_audio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_audio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_benchmark.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_bios.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_clocks.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_combios.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_connectors.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_cs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_cursor.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_device.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_display.c drm/radeon/radeon_display: Decrease the size of allocated memory 2024-11-19 14:19:32 +01:00
radeon_dp_auxch.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_dp_mst.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_drv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_drv.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_encoders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_family.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_fb.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_fence.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_gart.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_gem.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_i2c.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_ib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_irq_kms.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_kms.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_legacy_crtc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_legacy_encoders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_legacy_tv.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_mn.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_mode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_object.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_object.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_pm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_prime.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_ring.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_sa.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_semaphore.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_sync.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_test.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_trace.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_trace_points.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_ttm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_ucode.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_ucode.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_uvd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_vce.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
radeon_vm.c gpu/drm/radeon: fix two memleaks in radeon_vm_init 2024-11-18 12:12:41 +01:00
rs100d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs400.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs400d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs600.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs600d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs690.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs690d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs780_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs780_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rs780d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv6xx_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv6xx_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv6xxd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv200d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv250d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv350d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv515.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv515d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv730_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv730d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv740_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv740d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770_smc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
rv770d.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si.c drm/radeon: check return value of radeon_ring_lock() 2024-11-18 12:12:39 +01:00
si_blit_shaders.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_blit_shaders.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_dma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_dpm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_reg.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
si_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sid.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sislands_smc.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smu7.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smu7_discrete.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
smu7_fusion.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sumo_dpm.c drm/radeon: fix UBSAN warning in kv_dpm.c 2024-11-19 14:19:09 +01:00
sumo_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sumo_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sumod.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trinity_dpm.c drm/radeon/trinity_dpm: fix a memleak in trinity_parse_power_table 2024-11-18 12:12:40 +01:00
trinity_dpm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trinity_smc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
trinityd.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvd_v1_0.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvd_v2_2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvd_v3_1.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
uvd_v4_2.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vce_v1_0.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
vce_v2_0.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00