Re: [V4l2-library] Messed up syscall return value
"H. Willstrand" <[email protected]> Tue, 29 Jul 2008 00:35:20 +0200
| Newsgroups | gmane.comp.video.video4linux,gmane.linux.drivers.spca50x.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi! I think the memory allocation is wrong, you have NBUFFERS = 2 but memset( ... ) only allocates for 1 buffer. Regards, H.Willstrand On Tue, 2008-07-29 at 00:22 +0200, Jiri Slaby wrote: > On 07/29/2008 12:16 AM, Gregor Jasny wrote: > > ioctl(3, VIDIOC_REQBUFS or VT_DISALLOCATE, 0x7fffbfda0060) = 2 > > > > Huh? Something evils seems to be going on in V4L2 land. > > I've spotted the following lines in videobuf-core.c:videobuf_reqbufs > > > > req->count = retval; > > > > done: > > mutex_unlock(&q->vb_lock); > > return retval; > > > > That would explain the retval '2'. It seems a retval = 0; statement is missing here for the success case. > > Actually positive ioctl retval used to be often considered as OK in the past > (and this approach is still used in few char drivers). > > But according to v4l docco, it isn't permitted here. Anyway I wouldn't place it > in videobuf-core.c, but in vivi code; letting this decision on Mauro (CCed) ;). > > _______________________________________________ > V4L2-library mailing list > [email protected] > http://www.linuxtv.org/cgi-bin/mailman/listinfo/v4l2-library -- video4linux-list mailing list Unsubscribe mailto:[email protected]?subject=unsubscribe https://www.redhat.com/mailman/listinfo/video4linux-list