mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-27 15:40:10 -04:00
drm/panthor: Fix potential invalid pointer deref in group_process_tiler_oom()
If heaps is an ERR_PTR(), panthor_heap_pool_put() will deref an invalid
pointer. Make sure we set it to NULL in that case.
Fixes: de85488138 ("drm/panthor: Add the scheduler logical block")
Reported-by: sashiko-bot@kernel.org
Closes: https://sashiko.dev/#/patchset/20260625-panthor-signal-from-irq-v5-0-8836a74e0ef9@collabora.com?part=2
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patch.msgid.link/20260625-panthor-misc-fixes-v1-4-b67ed973fea6@collabora.com
This commit is contained in:
committed by
Liviu Dudau
parent
1b8d771fb2
commit
b39436d0ba
@@ -1600,7 +1600,10 @@ static int group_process_tiler_oom(struct panthor_group *group, u32 cs_id)
|
||||
if (unlikely(csg_id < 0))
|
||||
return 0;
|
||||
|
||||
if (IS_ERR(heaps) || frag_end > vt_end || vt_end >= vt_start) {
|
||||
if (IS_ERR(heaps)) {
|
||||
ret = -EINVAL;
|
||||
heaps = NULL;
|
||||
} else if (frag_end > vt_end || vt_end >= vt_start) {
|
||||
ret = -EINVAL;
|
||||
} else {
|
||||
/* We do the allocation without holding the scheduler lock to avoid
|
||||
|
||||
Reference in New Issue
Block a user