Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331081
b: refs/heads/master
c: 0657418
h: refs/heads/master
i:
  331079: 49f822b
v: v3
  • Loading branch information
Ezequiel Garcia authored and Mauro Carvalho Chehab committed Sep 25, 2012
1 parent 6e7cc41 commit 611fcfa
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 18ad89659a345c017ab61f758f9dfedab3c8190f
refs/heads/master: 065741840b1a58e94d2304b283286b355cbbc616
16 changes: 10 additions & 6 deletions trunk/drivers/media/usb/stk1160/stk1160-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ int stk1160_alloc_isoc(struct stk1160 *dev)
urb = usb_alloc_urb(max_packets, GFP_KERNEL);
if (!urb) {
stk1160_err("cannot alloc urb[%d]\n", i);
stk1160_uninit_isoc(dev);
return -ENOMEM;
goto free_i_bufs;
}
dev->isoc_ctl.urb[i] = urb;

Expand All @@ -474,10 +473,9 @@ int stk1160_alloc_isoc(struct stk1160 *dev)
dev->isoc_ctl.transfer_buffer[i] = kmalloc(sb_size, GFP_KERNEL);
#endif
if (!dev->isoc_ctl.transfer_buffer[i]) {
stk1160_err("cannot alloc %d bytes for tx buffer\n",
sb_size);
stk1160_uninit_isoc(dev);
return -ENOMEM;
stk1160_err("cannot alloc %d bytes for tx[%d] buffer\n",
sb_size, i);
goto free_i_bufs;
}
memset(dev->isoc_ctl.transfer_buffer[i], 0, sb_size);

Expand Down Expand Up @@ -514,5 +512,11 @@ int stk1160_alloc_isoc(struct stk1160 *dev)
dev->isoc_ctl.num_bufs = num_bufs;

return 0;

free_i_bufs:
/* Save the allocated buffers so far, so we can properly free them */
dev->isoc_ctl.num_bufs = i+1;
stk1160_free_isoc(dev);
return -ENOMEM;
}

0 comments on commit 611fcfa

Please sign in to comment.