aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cpia_usb.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2005-09-10 03:26:54 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2005-09-10 13:06:30 -0400
commitf9101210e7aa72daf92722d451a2f7e3af5f781f (patch)
tree9554007e19387f2d05352ab03332be50c5b95f5b /drivers/media/video/cpia_usb.c
parent887c27f369abc458556a5ce8ab22ddd498474307 (diff)
[PATCH] vfree and kfree cleanup in drivers/
This patch does a full cleanup of 'NULL checks before vfree', and a partial cleanup of calls to kfree for all of drivers/ - the kfree bit is partial in that I only did the files that also had vfree calls in them. The patch also gets rid of some redundant (void *) casts of pointers being passed to [vk]free, and a some tiny whitespace corrections also crept in. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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);