diff options
Diffstat (limited to 'drivers/media/video/vivi.c')
-rw-r--r-- | drivers/media/video/vivi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 474ddb779643..bacb311b4f24 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -535,9 +535,9 @@ static int vivi_start_thread(struct vivi_dmaqueue *dma_q) | |||
535 | 535 | ||
536 | dma_q->kthread = kthread_run(vivi_thread, dma_q, "vivi"); | 536 | dma_q->kthread = kthread_run(vivi_thread, dma_q, "vivi"); |
537 | 537 | ||
538 | if (dma_q->kthread == NULL) { | 538 | if (IS_ERR(dma_q->kthread)) { |
539 | printk(KERN_ERR "vivi: kernel_thread() failed\n"); | 539 | printk(KERN_ERR "vivi: kernel_thread() failed\n"); |
540 | return -EINVAL; | 540 | return PTR_ERR(dma_q->kthread); |
541 | } | 541 | } |
542 | dprintk(1,"returning from %s\n",__FUNCTION__); | 542 | dprintk(1,"returning from %s\n",__FUNCTION__); |
543 | return 0; | 543 | return 0; |
@@ -1363,7 +1363,9 @@ static void __exit vivi_exit(void) | |||
1363 | struct vivi_dev *h; | 1363 | struct vivi_dev *h; |
1364 | struct list_head *list; | 1364 | struct list_head *list; |
1365 | 1365 | ||
1366 | list_for_each(list,&vivi_devlist) { | 1366 | while (!list_empty(&vivi_devlist)) { |
1367 | list = vivi_devlist.next; | ||
1368 | list_del(list); | ||
1367 | h = list_entry(list, struct vivi_dev, vivi_devlist); | 1369 | h = list_entry(list, struct vivi_dev, vivi_devlist); |
1368 | kfree (h); | 1370 | kfree (h); |
1369 | } | 1371 | } |