Re: [PATCH] drm/amdgpu: Fix NULL pointer dereference

2022-04-09 Thread Grigory Vasilyev
errors that occur periodically under certain conditions and do not affect developers. Also, the user will not always be able to correctly write a bug report. Regards, Grigory. пт, 8 апр. 2022 г. в 17:30, Christian König : > > Am 08.04.22 um 15:21 schrieb Grigory Vasilyev: > > Simon

Re: [PATCH] drm/amdgpu: Senseless code and unnecessary memset

2022-04-09 Thread Grigory Vasilyev
I try to avoid memset. Regards, Grigory. ср, 6 апр. 2022 г. в 17:43, Christian König : > > Am 06.04.22 um 16:26 schrieb Jani Nikula: > > On Tue, 05 Apr 2022, Christian König wrote: > >> Am 05.04.22 um 19:36 schrieb Grigory Vasilyev: > >>> Using memset on local

Re: [PATCH] drm/amdgpu: Fix NULL pointer dereference

2022-04-08 Thread Grigory Vasilyev
Simon Ser and Bas Nieuwenhuizen, do you understand that you are proposing to make the code less safe in the future? In the future, someone might rewrite the code and we'll get an error. пт, 8 апр. 2022 г. в 14:48, Simon Ser : > > On Friday, April 8th, 2022 at 13:28, Bas Nieuwenhuizen > wrote: >

[PATCH] drm/amdgpu: Fix NULL pointer dereference

2022-04-08 Thread Grigory Vasilyev
The code below check for NULL, but is no check at this place, which is potentially dangerous. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b

[PATCH] drm/amdgpu: Fix incorrect enum type

2022-04-08 Thread Grigory Vasilyev
t AMDGPU_RING_PRIO_2 = 2 is used for compatibility with AMDGPU_GFX_PIPE_PRIO_HIGH = 2, and not change the behavior of the code. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/gfx_v9_

[PATCH] drm/amdgpu: Fix code with incorrect enum type

2022-04-07 Thread Grigory Vasilyev
t AMDGPU_RING_PRIO_2 = 2 is used for compatibility with AMDGPU_GFX_PIPE_PRIO_HIGH = 2, and not change the behavior of the code. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/

[PATCH 1/2] drm/amdgpu: Accessing to a null pointer

2022-04-06 Thread Grigory Vasilyev
A typo in the code. It was assumed that it was possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers

[PATCH] drm/amdgpu: Accessing to a null pointer

2022-04-06 Thread Grigory Vasilyev
A typo in the code. It was assumed that it was possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers

[PATCH] drm/amdgpu: Unnecessary code in gfx_v7_0.c

2022-04-06 Thread Grigory Vasilyev
The code is useless and doesn't change the value. (0 << GB_ADDR_CONFIG__ROW_SIZE__SHIFT) = 0 gb_addr_config | 0 = gb_addr_config Perhaps there could be 1 instead of 0, but this does not correspond with the logic of the switch. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm

[PATCH] drm/amdgpu: Accessing to a null pointer

2022-04-06 Thread Grigory Vasilyev
A typo in the code. It was assumed that it was possible to shift the pointer to sizeof(BIOS_ATOM_PREFIX) - 1. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/atom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/atom.c b/drivers

[PATCH] drm/amdgpu: Senseless code and unnecessary memset

2022-04-06 Thread Grigory Vasilyev
Using memset on local arrays before exiting the function is pointless. Compilator will remove this code. Also for local arrays is preferable to use {0} instead of memset. Mistakes are often made when working with memset. Signed-off-by: Grigory Vasilyev --- drivers/gpu/drm/amd/amdgpu/atom.c | 8

[PATCH] drm/amdgpu: Junk code

2022-04-05 Thread Grigory Vasilyev
Variable igp_lane_info always is 0. 0 & any value = 0 and false. In this way, all сonditional statements will false. Therefore, it is not clear what this code does. Signed-off-by: Grigory Vasilyev --- .../gpu/drm/amd/amdgpu/atombios_encoders.c| 21 --- 1 file changed

[PATCH] drm/amdkfd: Fix potential NULL pointer dereference

2022-04-05 Thread Grigory Vasilyev
In the amdgpu_amdkfd_get_xgmi_bandwidth_mbytes function, the peer_adev pointer can be NULL and is passed to amdgpu_xgmi_get_num_links. In amdgpu_xgmi_get_num_links, peer_adev pointer is dereferenced without any checks: peer_adev->gmc.xgmi.node_id . Signed-off-by: Grigory Vasilyev --- driv