summaryrefslogtreecommitdiff
path: root/src/cl_program.c
diff options
context:
space:
mode:
authorHomer Hsing <homer.xing@intel.com>2013-11-01 13:53:47 +0800
committerZhigang Gong <zhigang.gong@intel.com>2013-11-04 15:34:03 +0800
commita4f141747dbcf86039bb017fef419d958441fb08 (patch)
treeacb4faf20d9e907103e212e29f2b7b68ccda1f14 /src/cl_program.c
parent3d272fea44546c3579e347e786c3a5a9f5066b6a (diff)
fix pointer bugs in linked list
change the header of linked list if the header was deleted Signed-off-by: Homer Hsing <homer.xing@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'src/cl_program.c')
-rw-r--r--src/cl_program.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cl_program.c b/src/cl_program.c
index b0c29bf3..b8da052b 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -79,8 +79,8 @@ cl_program_delete(cl_program p)
p->prev->next = p->next;
if (p->next)
p->next->prev = p->prev;
- if (p->prev == NULL && p->next == NULL)
- p->ctx->programs = NULL;
+ if (p->ctx->programs == p)
+ p->ctx->programs = p->next;
pthread_mutex_unlock(&p->ctx->program_lock);
cl_free(p->bin); /* Free the blob */