aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
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/net
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/net')
-rw-r--r--drivers/net/bsd_comp.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/net/bsd_comp.c b/drivers/net/bsd_comp.c
index 3d88ad622bdb..fb4098ed469e 100644
--- a/drivers/net/bsd_comp.c
+++ b/drivers/net/bsd_comp.c
@@ -323,33 +323,27 @@ static void bsd_reset (void *state)
323 */ 323 */
324 324
325static void bsd_free (void *state) 325static void bsd_free (void *state)
326 { 326{
327 struct bsd_db *db = (struct bsd_db *) state; 327 struct bsd_db *db = state;
328 328
329 if (db) 329 if (!db)
330 { 330 return;
331
331/* 332/*
332 * Release the dictionary 333 * Release the dictionary
333 */ 334 */
334 if (db->dict) 335 vfree(db->dict);
335 { 336 db->dict = NULL;
336 vfree (db->dict);
337 db->dict = NULL;
338 }
339/* 337/*
340 * Release the string buffer 338 * Release the string buffer
341 */ 339 */
342 if (db->lens) 340 vfree(db->lens);
343 { 341 db->lens = NULL;
344 vfree (db->lens);
345 db->lens = NULL;
346 }
347/* 342/*
348 * Finally release the structure itself. 343 * Finally release the structure itself.
349 */ 344 */
350 kfree (db); 345 kfree(db);
351 } 346}
352 }
353 347
354/* 348/*
355 * Allocate space for a (de) compressor. 349 * Allocate space for a (de) compressor.