aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/hvcs.c
diff options
context:
space:
mode:
authorJesper Juhl <jesper.juhl@gmail.com>2006-06-27 05:55:06 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-27 20:32:48 -0400
commit8f7607803717e9d045965b210cd16a25d80cd04b (patch)
tree1e8af970aa305be5e229a86b3ccc2525f3936d3b /drivers/char/hvcs.c
parent9a66a53f558efc2619a438278d2919b3c9a7f673 (diff)
[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.c11
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 = {
1320static int hvcs_alloc_index_list(int n) 1320static int hvcs_alloc_index_list(int n)
1321{ 1321{
1322 int i; 1322 int i;
1323
1323 hvcs_index_list = kmalloc(n * sizeof(hvcs_index_count),GFP_KERNEL); 1324 hvcs_index_list = kmalloc(n * sizeof(hvcs_index_count),GFP_KERNEL);
1324 if (!hvcs_index_list) 1325 if (!hvcs_index_list)
1325 return -ENOMEM; 1326 return -ENOMEM;
1326 hvcs_index_count = n; 1327 hvcs_index_count = n;
1327 for(i = 0; i < hvcs_index_count; i++) 1328 for (i = 0; i < hvcs_index_count; i++)
1328 hvcs_index_list[i] = -1; 1329 hvcs_index_list[i] = -1;
1329 return 0; 1330 return 0;
1330} 1331}
@@ -1332,11 +1333,9 @@ static int hvcs_alloc_index_list(int n)
1332static void hvcs_free_index_list(void) 1333static void hvcs_free_index_list(void)
1333{ 1334{
1334 /* Paranoia check to be thorough. */ 1335 /* Paranoia check to be thorough. */
1335 if (hvcs_index_list) { 1336 kfree(hvcs_index_list);
1336 kfree(hvcs_index_list); 1337 hvcs_index_list = NULL;
1337 hvcs_index_list = NULL; 1338 hvcs_index_count = 0;
1338 hvcs_index_count = 0;
1339 }
1340} 1339}
1341 1340
1342static int __init hvcs_module_init(void) 1341static int __init hvcs_module_init(void)