]> git.baikalelectronics.ru Git - kernel.git/commit
drm/v3d: Fix null pointer dereference of pointer perfmon
authorColin Ian King <colin.i.king@gmail.com>
Sun, 24 Apr 2022 18:35:12 +0000 (19:35 +0100)
committerMelissa Wen <melissa.srw@gmail.com>
Tue, 26 Apr 2022 12:55:28 +0000 (11:55 -0100)
commitf14e53561bc20577405aeda27e8b07858a12c540
treef082e2eee996ad9ebd25b95a0da6a5b2af925725
parente75cecd3c56d337951775279c0c8fdf9553d80b3
drm/v3d: Fix null pointer dereference of pointer perfmon

In the unlikely event that pointer perfmon is null the WARN_ON return path
occurs after the pointer has already been deferenced. Fix this by only
dereferencing perfmon after it has been null checked.

Fixes: cdd0ff9d3d28 ("drm/v3d: Expose performance counters to userspace")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220424183512.1365683-1-colin.i.king@gmail.com
drivers/gpu/drm/v3d/v3d_perfmon.c