diff options
author | Jesper Juhl <jesper.juhl@gmail.com> | 2006-06-27 11:55:06 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-28 02:32:48 +0200 |
commit | 8f7607803717e9d045965b210cd16a25d80cd04b (patch) | |
tree | 1e8af970aa305be5e229a86b3ccc2525f3936d3b /drivers/char/hvcs.c | |
parent | [PATCH] Remove redundant NULL checks before [kv]free - in kernel/ (diff) | |
download | linux-8f7607803717e9d045965b210cd16a25d80cd04b.tar.xz linux-8f7607803717e9d045965b210cd16a25d80cd04b.zip |
[PATCH] Remove redundant NULL checks before [kv]free - in drivers/
Remove redundant NULL chck before kfree + tiny CodingStyle cleanup for
drivers/
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/char/hvcs.c')
-rw-r--r-- | drivers/char/hvcs.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/char/hvcs.c b/drivers/char/hvcs.c index 8d97b3911293..afa26b65dac3 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c @@ -1320,11 +1320,12 @@ static struct tty_operations hvcs_ops = { static int hvcs_alloc_index_list(int n) { int i; + hvcs_index_list = kmalloc(n * sizeof(hvcs_index_count),GFP_KERNEL); if (!hvcs_index_list) return -ENOMEM; hvcs_index_count = n; - for(i = 0; i < hvcs_index_count; i++) + for (i = 0; i < hvcs_index_count; i++) hvcs_index_list[i] = -1; return 0; } @@ -1332,11 +1333,9 @@ static int hvcs_alloc_index_list(int n) static void hvcs_free_index_list(void) { /* Paranoia check to be thorough. */ - if (hvcs_index_list) { - kfree(hvcs_index_list); - hvcs_index_list = NULL; - hvcs_index_count = 0; - } + kfree(hvcs_index_list); + hvcs_index_list = NULL; + hvcs_index_count = 0; } static int __init hvcs_module_init(void) |