summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/lima/lima_sched.c
diff options
context:
space:
mode:
authorColin Ian King <colin.i.king@gmail.com>2022-04-26 13:25:31 +0100
committerShuah Khan <skhan@linuxfoundation.org>2022-04-26 09:20:00 -0600
commitc7b607fa9325ccc94982774c505176677117689c (patch)
tree33b334994df733d8f2a6f69acdca66d1312c0072 /drivers/gpu/drm/lima/lima_sched.c
parent68c4844985d1f8c1b1a71dfcdbfacb5a30babc95 (diff)
selftests/resctrl: Fix null pointer dereference on open failed
Currently if opening /dev/null fails to open then file pointer fp is null and further access to fp via fprintf will cause a null pointer dereference. Fix this by returning a negative error value when a null fp is detected. Detected using cppcheck static analysis: tools/testing/selftests/resctrl/fill_buf.c:124:6: note: Assuming that condition '!fp' is not redundant if (!fp) ^ tools/testing/selftests/resctrl/fill_buf.c:126:10: note: Null pointer dereference fprintf(fp, "Sum: %d ", ret); Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark") Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'drivers/gpu/drm/lima/lima_sched.c')
0 files changed, 0 insertions, 0 deletions