FROMLIST: drm/msm: Avoid NULL dereference in msm_disp_state_print_regs()
If the allocation in msm_disp_state_dump_regs() failed then
`block->state` can be NULL. The msm_disp_state_print_regs() function
_does_ have code to try to handle it with:
if (*reg)
dump_addr = *reg;
...but since "dump_addr" is initialized to NULL the above is actually
a noop. The code then goes on to dereference `dump_addr`.
Make the function print "Registers not stored" when it sees a NULL to
solve this. Since we're touching the code, fix
msm_disp_state_print_regs() not to pointlessly take a double-pointer
and properly mark the pointer as `const`.
Fixes: 98659487 ("drm/msm: add support to take dpu snapshot")
Signed-off-by:
Douglas Anderson <dianders@chromium.org>
Reviewed-by:
Abhinav Kumar <quic_abhinavk@quicinc.com>
(am from https://patchwork.kernel.org/patch/13835318/)
(also found at https://lore.kernel.org/r/20241014093605.1.Ia1217cecec9ef09eb3c6d125360cc6c8574b0e73@changeid)
UPSTREAM-TASK=b:374146921
BUG=b:372769248, b:372926092
TEST=With test patch force memory alloc to fail and force a dpu core dump
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/5941458
Tested-by:
Douglas Anderson <dianders@chromium.org>
Reviewed-by:
Rob Clark <robdclark@chromium.org>
Reviewed-by:
Sean Paul <sean@poorly.run>
Commit-Queue: Douglas Anderson <dianders@chromium.org>
Change-Id: I5ce81f8f0bbe070204dc7f5a6db1f48d6732807b
Signed-off-by:
Hubert Mazur <hmazur@google.com>
Signed-off-by:
Tomasz Nowicki <tnowicki@google.com>
Loading
Please sign in to comment