Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 44036
b: refs/heads/master
c: c85f49d
h: refs/heads/master
v: v3
  • Loading branch information
Amit Choudhary authored and Mauro Carvalho Chehab committed Dec 10, 2006
1 parent 554c3bf commit 75022ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fe16af26c849eb75134855c7be22352f1a15844c
refs/heads/master: c85f49d49f437605550322bd2739af18230cf85b
21 changes: 18 additions & 3 deletions trunk/drivers/media/video/stv680.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ static int stv680_start_stream (struct usb_stv *stv680)
stv680->sbuf[i].data = kmalloc (stv680->rawbufsize, GFP_KERNEL);
if (stv680->sbuf[i].data == NULL) {
PDEBUG (0, "STV(e): Could not kmalloc raw data buffer %i", i);
return -1;
goto nomem_err;
}
}

Expand All @@ -698,15 +698,15 @@ static int stv680_start_stream (struct usb_stv *stv680)
stv680->scratch[i].data = kmalloc (stv680->rawbufsize, GFP_KERNEL);
if (stv680->scratch[i].data == NULL) {
PDEBUG (0, "STV(e): Could not kmalloc raw scratch buffer %i", i);
return -1;
goto nomem_err;
}
stv680->scratch[i].state = BUFFER_UNUSED;
}

for (i = 0; i < STV680_NUMSBUF; i++) {
urb = usb_alloc_urb (0, GFP_KERNEL);
if (!urb)
return -ENOMEM;
goto nomem_err;

/* sbuf is urb->transfer_buffer, later gets memcpyed to scratch */
usb_fill_bulk_urb (urb, stv680->udev,
Expand All @@ -721,6 +721,21 @@ static int stv680_start_stream (struct usb_stv *stv680)

stv680->framecount = 0;
return 0;

nomem_err:
for (i = 0; i < STV680_NUMSCRATCH; i++) {
kfree(stv680->scratch[i].data);
stv680->scratch[i].data = NULL;
}
for (i = 0; i < STV680_NUMSBUF; i++) {
usb_kill_urb(stv680->urb[i]);
usb_free_urb(stv680->urb[i]);
stv680->urb[i] = NULL;
kfree(stv680->sbuf[i].data);
stv680->sbuf[i].data = NULL;
}
return -ENOMEM;

}

static int stv680_stop_stream (struct usb_stv *stv680)
Expand Down

0 comments on commit 75022ff

Please sign in to comment.