Commit 4c2f7f72 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] ivtv: steal could be NULL

ivtv_flush_queues() calls ivtv_queue_move() with steal == NULL.
However, part of the code assumes that steal could be not null, as
pointed by smatch:
	drivers/media/pci/ivtv/ivtv-queue.c:145 ivtv_queue_move() error: we previously assumed 'steal' could be null (see line 138)

This has the potential of causing an OOPS when the queue is
flushed.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent d079e36d
...@@ -141,7 +141,7 @@ int ivtv_queue_move(struct ivtv_stream *s, struct ivtv_queue *from, struct ivtv_ ...@@ -141,7 +141,7 @@ int ivtv_queue_move(struct ivtv_stream *s, struct ivtv_queue *from, struct ivtv_
spin_unlock_irqrestore(&s->qlock, flags); spin_unlock_irqrestore(&s->qlock, flags);
return -ENOMEM; return -ENOMEM;
} }
while (bytes_available < needed_bytes) { while (steal && bytes_available < needed_bytes) {
struct ivtv_buffer *buf = list_entry(steal->list.prev, struct ivtv_buffer, list); struct ivtv_buffer *buf = list_entry(steal->list.prev, struct ivtv_buffer, list);
u16 dma_xfer_cnt = buf->dma_xfer_cnt; u16 dma_xfer_cnt = buf->dma_xfer_cnt;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment