nbio_v7_4: Add pointer check
Subsystems (2)
PATCH 1/1 nbio_v7_4: Add pointer check
Return value of a function 'amdgpu_ras_find_obj' is dereferenced at nbio_v7_4.c:325 without checking for null
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +2 -0
@@ -304,6 +304,9 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_devicestruct ras_err_data err_data = {0 ,0 ,0 ,NULL };struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); +if (!obj) +return ; bif_doorbell_intr_cntl =RREG32_SOC15 (NBIO ,0 , mmBIF_DOORBELL_INT_CNTL); if (REG_GET_FIELD(bif_doorbell_intr_cntl,
BIF_DOORBELL_INT_CNTL, RAS_CNTLR_INTERRUPT_STATUS)) {
Signature · 1 line
2.25.1
Quoted 1 line · Denis Arefev
Return value of a function '
amdgpu_ras_find_obj' is dereferenced at nbio_v7_4.c:325 without checking for null
This line is too long, you should be wrapping lines at 75 characters. Could you run your patch through checkpatch?
Quoted 4 lines
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by Denis Arefev <[email protected]>
Probably should include this tag:
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +0
-0
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device · line 309
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +2
-0@@ -304,6 +304,9 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_devicestruct ras_err_data err_data = {0 ,0 ,0 ,NULL };struct amdgpu_ras *ras =amdgpu_ras_get_context (adev); +if (!obj) +return ;
Whitespace seems inconsistent here.
Quoted 3 lines
drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +0
-0bif_doorbell_intr_cntl =RREG32_SOC15 (NBIO ,0 , mmBIF_DOORBELL_INT_CNTL);if (REG_GET_FIELD (bif_doorbell_intr_cntl,BIF_DOORBELL_INT_CNTL ,RAS_CNTLR_INTERRUPT_STATUS )) {