diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2005-09-10 03:26:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-10 13:06:30 -0400 |
commit | f9101210e7aa72daf92722d451a2f7e3af5f781f (patch) | |
tree | 9554007e19387f2d05352ab03332be50c5b95f5b /drivers/usb/media | |
parent | 887c27f369abc458556a5ce8ab22ddd498474307 (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/usb/media')
-rw-r--r-- | drivers/usb/media/stv680.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/usb/media/stv680.c b/drivers/usb/media/stv680.c index 7398a7f19c1e..0fd0fa9fec21 100644 --- a/drivers/usb/media/stv680.c +++ b/drivers/usb/media/stv680.c | |||
@@ -260,7 +260,7 @@ static int stv_stop_video (struct usb_stv *dev) | |||
260 | PDEBUG (0, "STV(i): Camera set to original resolution"); | 260 | PDEBUG (0, "STV(i): Camera set to original resolution"); |
261 | } | 261 | } |
262 | /* origMode */ | 262 | /* origMode */ |
263 | kfree (buf); | 263 | kfree(buf); |
264 | return i; | 264 | return i; |
265 | } | 265 | } |
266 | 266 | ||
@@ -276,7 +276,7 @@ static int stv_set_video_mode (struct usb_stv *dev) | |||
276 | } | 276 | } |
277 | 277 | ||
278 | if ((i = stv_set_config (dev, 1, 0, 0)) < 0) { | 278 | if ((i = stv_set_config (dev, 1, 0, 0)) < 0) { |
279 | kfree (buf); | 279 | kfree(buf); |
280 | return i; | 280 | return i; |
281 | } | 281 | } |
282 | 282 | ||
@@ -301,13 +301,13 @@ static int stv_set_video_mode (struct usb_stv *dev) | |||
301 | goto exit; | 301 | goto exit; |
302 | 302 | ||
303 | error: | 303 | error: |
304 | kfree (buf); | 304 | kfree(buf); |
305 | if (stop_video == 1) | 305 | if (stop_video == 1) |
306 | stv_stop_video (dev); | 306 | stv_stop_video (dev); |
307 | return -1; | 307 | return -1; |
308 | 308 | ||
309 | exit: | 309 | exit: |
310 | kfree (buf); | 310 | kfree(buf); |
311 | return 0; | 311 | return 0; |
312 | } | 312 | } |
313 | 313 | ||
@@ -327,7 +327,7 @@ static int stv_init (struct usb_stv *stv680) | |||
327 | 327 | ||
328 | /* set config 1, interface 0, alternate 0 */ | 328 | /* set config 1, interface 0, alternate 0 */ |
329 | if ((i = stv_set_config (stv680, 1, 0, 0)) < 0) { | 329 | if ((i = stv_set_config (stv680, 1, 0, 0)) < 0) { |
330 | kfree (buffer); | 330 | kfree(buffer); |
331 | PDEBUG (0, "STV(e): set config 1,0,0 failed"); | 331 | PDEBUG (0, "STV(e): set config 1,0,0 failed"); |
332 | return -1; | 332 | return -1; |
333 | } | 333 | } |
@@ -435,11 +435,11 @@ static int stv_init (struct usb_stv *stv680) | |||
435 | error: | 435 | error: |
436 | i = stv_sndctrl (0, stv680, 0x80, 0, buffer, 0x02); /* Get Last Error */ | 436 | i = stv_sndctrl (0, stv680, 0x80, 0, buffer, 0x02); /* Get Last Error */ |
437 | PDEBUG (1, "STV(i): last error: %i, command = 0x%x", buffer[0], buffer[1]); | 437 | PDEBUG (1, "STV(i): last error: %i, command = 0x%x", buffer[0], buffer[1]); |
438 | kfree (buffer); | 438 | kfree(buffer); |
439 | return -1; | 439 | return -1; |
440 | 440 | ||
441 | exit: | 441 | exit: |
442 | kfree (buffer); | 442 | kfree(buffer); |
443 | 443 | ||
444 | /* video = 320x240, 352x288 */ | 444 | /* video = 320x240, 352x288 */ |
445 | if (stv680->CIF == 1) { | 445 | if (stv680->CIF == 1) { |
@@ -708,10 +708,10 @@ static int stv680_stop_stream (struct usb_stv *stv680) | |||
708 | usb_kill_urb (stv680->urb[i]); | 708 | usb_kill_urb (stv680->urb[i]); |
709 | usb_free_urb (stv680->urb[i]); | 709 | usb_free_urb (stv680->urb[i]); |
710 | stv680->urb[i] = NULL; | 710 | stv680->urb[i] = NULL; |
711 | kfree (stv680->sbuf[i].data); | 711 | kfree(stv680->sbuf[i].data); |
712 | } | 712 | } |
713 | for (i = 0; i < STV680_NUMSCRATCH; i++) { | 713 | for (i = 0; i < STV680_NUMSCRATCH; i++) { |
714 | kfree (stv680->scratch[i].data); | 714 | kfree(stv680->scratch[i].data); |
715 | stv680->scratch[i].data = NULL; | 715 | stv680->scratch[i].data = NULL; |
716 | } | 716 | } |
717 | 717 | ||
@@ -1068,7 +1068,7 @@ static int stv_close (struct inode *inode, struct file *file) | |||
1068 | stv680->user = 0; | 1068 | stv680->user = 0; |
1069 | 1069 | ||
1070 | if (stv680->removed) { | 1070 | if (stv680->removed) { |
1071 | kfree (stv680); | 1071 | kfree(stv680); |
1072 | stv680 = NULL; | 1072 | stv680 = NULL; |
1073 | PDEBUG (0, "STV(i): device unregistered"); | 1073 | PDEBUG (0, "STV(i): device unregistered"); |
1074 | } | 1074 | } |
@@ -1445,14 +1445,14 @@ static inline void usb_stv680_remove_disconnected (struct usb_stv *stv680) | |||
1445 | usb_kill_urb (stv680->urb[i]); | 1445 | usb_kill_urb (stv680->urb[i]); |
1446 | usb_free_urb (stv680->urb[i]); | 1446 | usb_free_urb (stv680->urb[i]); |
1447 | stv680->urb[i] = NULL; | 1447 | stv680->urb[i] = NULL; |
1448 | kfree (stv680->sbuf[i].data); | 1448 | kfree(stv680->sbuf[i].data); |
1449 | } | 1449 | } |
1450 | for (i = 0; i < STV680_NUMSCRATCH; i++) | 1450 | for (i = 0; i < STV680_NUMSCRATCH; i++) |
1451 | kfree (stv680->scratch[i].data); | 1451 | kfree(stv680->scratch[i].data); |
1452 | PDEBUG (0, "STV(i): %s disconnected", stv680->camera_name); | 1452 | PDEBUG (0, "STV(i): %s disconnected", stv680->camera_name); |
1453 | 1453 | ||
1454 | /* Free the memory */ | 1454 | /* Free the memory */ |
1455 | kfree (stv680); | 1455 | kfree(stv680); |
1456 | } | 1456 | } |
1457 | 1457 | ||
1458 | static void stv680_disconnect (struct usb_interface *intf) | 1458 | static void stv680_disconnect (struct usb_interface *intf) |