提交 ff41efcf 编写于 作者: D Douglas Schilling Landgraf 提交者: Mauro Carvalho Chehab

V4L/DVB (8883): w9968cf: Fix order of usb_alloc_urb validation

Fixed order of usb_alloc_urb pointer validation.

Cc: Luca Risolia <luca.risolia@studio.unibo.it>
Signed-off-by: NDouglas Schilling Landgraf <dougsland@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 6c832e36
...@@ -911,7 +911,6 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam) ...@@ -911,7 +911,6 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
for (i = 0; i < W9968CF_URBS; i++) { for (i = 0; i < W9968CF_URBS; i++) {
urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL); urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL);
cam->urb[i] = urb;
if (!urb) { if (!urb) {
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
usb_free_urb(cam->urb[j]); usb_free_urb(cam->urb[j]);
...@@ -919,6 +918,7 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam) ...@@ -919,6 +918,7 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
return -ENOMEM; return -ENOMEM;
} }
cam->urb[i] = urb;
urb->dev = udev; urb->dev = udev;
urb->context = (void*)cam; urb->context = (void*)cam;
urb->pipe = usb_rcvisocpipe(udev, 1); urb->pipe = usb_rcvisocpipe(udev, 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册