commit 32d26b5859263127653e62b86b006fbd62187e35
parent 76c775e3da72823adc56c3af98c2e24dc4fde3ca
Author: alex <alex@022568fa-442e-4ef8-a3e8-54dcafdb011a>
Date: Sat, 12 Jan 2008 02:50:07 +0000
Fix de-ref of null/empty pointers.
git-svn-id: http://svn.mediati.org/svn/r5u870/trunk@28 022568fa-442e-4ef8-a3e8-54dcafdb011a
Diffstat:
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/usbcam.c b/usbcam.c
@@ -281,17 +281,18 @@ int usbcam_curframe_get(struct usbcam_dev *udp, struct usbcam_curframe *cf)
{
struct usbcam_frame *framep = usbcam_capture_curframe(udp);
struct videobuf_dmabuf *dma;
+
+ usbcam_chklock(udp);
+
+ if (!framep || !&framep->vbb)
+ return -ENOENT;
+
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
dma = &framep->vbb.dma;
#else
dma = videobuf_to_dma(&framep->vbb);
#endif
- usbcam_chklock(udp);
-
- if (!framep)
- return -ENOENT;
-
cf->uc_base = (u8 *) (framep->vmap_sof
? framep->vmap_sof
: dma->vmalloc);
@@ -1401,7 +1402,7 @@ static int usbcam_v4l_int_ioctl(struct inode *inodep, struct file *filp,
{
usbcam_dbg(udp, IOCTL_BUF,
"VIDIOCGMBUF reqbufs failed: device was busy"
- " - closing and trying again.");
+ " - closing and trying again.");
res = videobuf_streamoff(&ufp->uf_vbq);
if (res < 0)