Skip to content

Commit

Permalink
gpu: ion: dereferencing an ERR_PTR
Browse files Browse the repository at this point in the history
We dereference "heap->task" before checking if it's an ERR_PTR.

Fixes: ea313b5 ('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>
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Feb 7, 2014
1 parent 791771e commit 54de9af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/staging/android/ion/ion_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &param);
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, &param);
return 0;
}

Expand Down

0 comments on commit 54de9af

Please sign in to comment.