Skip to content

Commit

Permalink
V4L/DVB (8883): w9968cf: Fix order of usb_alloc_urb validation
Browse files Browse the repository at this point in the history
Fixed order of usb_alloc_urb pointer validation.

Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Douglas Schilling Landgraf authored and Mauro Carvalho Chehab committed Sep 29, 2008
1 parent 6c832e3 commit ff41efc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/media/video/w9968cf.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,14 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)

for (i = 0; i < W9968CF_URBS; i++) {
urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL);
cam->urb[i] = urb;
if (!urb) {
for (j = 0; j < i; j++)
usb_free_urb(cam->urb[j]);
DBG(1, "Couldn't allocate the URB structures")
return -ENOMEM;
}

cam->urb[i] = urb;
urb->dev = udev;
urb->context = (void*)cam;
urb->pipe = usb_rcvisocpipe(udev, 1);
Expand Down

0 comments on commit ff41efc

Please sign in to comment.