mirror of
https://github.com/torvalds/linux.git
synced 2024-11-16 17:12:06 +00:00
gpu: ion: dereferencing an ERR_PTR
We dereference "heap->task" before checking if it's an ERR_PTR.
Fixes: ea313b5f88
('gpu: ion: Also shrink memory cached in the deferred free list')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
791771e4e0
commit
54de9af9f0
@ -243,12 +243,12 @@ int ion_heap_init_deferred_free(struct ion_heap *heap)
|
||||
init_waitqueue_head(&heap->waitqueue);
|
||||
heap->task = kthread_run(ion_heap_deferred_free, heap,
|
||||
"%s", heap->name);
|
||||
sched_setscheduler(heap->task, SCHED_IDLE, ¶m);
|
||||
if (IS_ERR(heap->task)) {
|
||||
pr_err("%s: creating thread for deferred free failed\n",
|
||||
__func__);
|
||||
return PTR_RET(heap->task);
|
||||
}
|
||||
sched_setscheduler(heap->task, SCHED_IDLE, ¶m);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user