aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cpia_usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cpia_usb.c')
-rw-r--r--drivers/media/video/cpia_usb.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/drivers/media/video/cpia_usb.c b/drivers/media/video/cpia_usb.c
index cdda423386c5..9774e94d1e7d 100644
--- a/drivers/media/video/cpia_usb.c
+++ b/drivers/media/video/cpia_usb.c
@@ -445,10 +445,8 @@ static void cpia_usb_free_resources(struct usb_cpia *ucpia, int try)
445 ucpia->sbuf[1].urb = NULL; 445 ucpia->sbuf[1].urb = NULL;
446 } 446 }
447 447
448 if (ucpia->sbuf[1].data) { 448 kfree(ucpia->sbuf[1].data);
449 kfree(ucpia->sbuf[1].data); 449 ucpia->sbuf[1].data = NULL;
450 ucpia->sbuf[1].data = NULL;
451 }
452 450
453 if (ucpia->sbuf[0].urb) { 451 if (ucpia->sbuf[0].urb) {
454 usb_kill_urb(ucpia->sbuf[0].urb); 452 usb_kill_urb(ucpia->sbuf[0].urb);
@@ -456,10 +454,8 @@ static void cpia_usb_free_resources(struct usb_cpia *ucpia, int try)
456 ucpia->sbuf[0].urb = NULL; 454 ucpia->sbuf[0].urb = NULL;
457 } 455 }
458 456
459 if (ucpia->sbuf[0].data) { 457 kfree(ucpia->sbuf[0].data);
460 kfree(ucpia->sbuf[0].data); 458 ucpia->sbuf[0].data = NULL;
461 ucpia->sbuf[0].data = NULL;
462 }
463} 459}
464 460
465static int cpia_usb_close(void *privdata) 461static int cpia_usb_close(void *privdata)
@@ -623,20 +619,14 @@ static void cpia_disconnect(struct usb_interface *intf)
623 619
624 ucpia->curbuff = ucpia->workbuff = NULL; 620 ucpia->curbuff = ucpia->workbuff = NULL;
625 621
626 if (ucpia->buffers[2]) { 622 vfree(ucpia->buffers[2]);
627 vfree(ucpia->buffers[2]); 623 ucpia->buffers[2] = NULL;
628 ucpia->buffers[2] = NULL;
629 }
630 624
631 if (ucpia->buffers[1]) { 625 vfree(ucpia->buffers[1]);
632 vfree(ucpia->buffers[1]); 626 ucpia->buffers[1] = NULL;
633 ucpia->buffers[1] = NULL;
634 }
635 627
636 if (ucpia->buffers[0]) { 628 vfree(ucpia->buffers[0]);
637 vfree(ucpia->buffers[0]); 629 ucpia->buffers[0] = NULL;
638 ucpia->buffers[0] = NULL;
639 }
640 630
641 cam->lowlevel_data = NULL; 631 cam->lowlevel_data = NULL;
642 kfree(ucpia); 632 kfree(ucpia);