aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/usbvision/usbvision-video.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/usbvision/usbvision-video.c')
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index b77e25ea8838..31b133ef0698 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -353,20 +353,15 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
353 if(!errCode) { 353 if(!errCode) {
354 /* Allocate memory for the scratch ring buffer */ 354 /* Allocate memory for the scratch ring buffer */
355 errCode = usbvision_scratch_alloc(usbvision); 355 errCode = usbvision_scratch_alloc(usbvision);
356 if(!errCode) { 356 if ((!errCode) && (isocMode==ISOC_MODE_COMPRESS)) {
357 /* Allocate memory for the USB S buffers */ 357 /* Allocate intermediate decompression buffers only if needed */
358 errCode = usbvision_sbuf_alloc(usbvision); 358 errCode = usbvision_decompress_alloc(usbvision);
359 if ((!errCode) && (usbvision->isocMode==ISOC_MODE_COMPRESS)) {
360 /* Allocate intermediate decompression buffers only if needed */
361 errCode = usbvision_decompress_alloc(usbvision);
362 }
363 } 359 }
364 } 360 }
365 if (errCode) { 361 if (errCode) {
366 /* Deallocate all buffers if trouble */ 362 /* Deallocate all buffers if trouble */
367 usbvision_frames_free(usbvision); 363 usbvision_frames_free(usbvision);
368 usbvision_scratch_free(usbvision); 364 usbvision_scratch_free(usbvision);
369 usbvision_sbuf_free(usbvision);
370 usbvision_decompress_free(usbvision); 365 usbvision_decompress_free(usbvision);
371 } 366 }
372 } 367 }
@@ -437,9 +432,8 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file)
437 usbvision_stop_isoc(usbvision); 432 usbvision_stop_isoc(usbvision);
438 433
439 usbvision_decompress_free(usbvision); 434 usbvision_decompress_free(usbvision);
440 usbvision_rvfree(usbvision->fbuf, usbvision->fbuf_size); 435 usbvision_frames_free(usbvision);
441 usbvision_scratch_free(usbvision); 436 usbvision_scratch_free(usbvision);
442 usbvision_sbuf_free(usbvision);
443 437
444 usbvision->user--; 438 usbvision->user--;
445 439