Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 82f0efbc authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[media] tm6000: fix an uninitialized variable



tm6000_poll could use an uninitialized buf pointer. Move the buf-handling
code inside the 'if' that initializes the buf pointer.

Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent bf5bbed1
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -1455,14 +1455,14 @@ __tm6000_poll(struct file *file, struct poll_table_struct *wait)
		if (list_empty(&fh->vb_vidq.stream))
		if (list_empty(&fh->vb_vidq.stream))
			return res | POLLERR;
			return res | POLLERR;
		buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
		buf = list_entry(fh->vb_vidq.stream.next, struct tm6000_buffer, vb.stream);
	} else if (req_events & (POLLIN | POLLRDNORM)) {
		/* read() capture */
		return res | videobuf_poll_stream(file, &fh->vb_vidq, wait);
	}
		poll_wait(file, &buf->vb.done, wait);
		poll_wait(file, &buf->vb.done, wait);
		if (buf->vb.state == VIDEOBUF_DONE ||
		if (buf->vb.state == VIDEOBUF_DONE ||
		    buf->vb.state == VIDEOBUF_ERROR)
		    buf->vb.state == VIDEOBUF_ERROR)
			return res | POLLIN | POLLRDNORM;
			return res | POLLIN | POLLRDNORM;
	} else if (req_events & (POLLIN | POLLRDNORM)) {
		/* read() capture */
		return res | videobuf_poll_stream(file, &fh->vb_vidq, wait);
	}
	return res;
	return res;
}
}