diff options
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 2019175a2227..130dedc37568 100644 --- a/drivers/char/hvcs.c +++ b/drivers/char/hvcs.c | |||
@@ -1320,11 +1320,12 @@ static struct tty_operations hvcs_ops = { | |||
1320 | static int hvcs_alloc_index_list(int n) | 1320 | static 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) | |||
1332 | static void hvcs_free_index_list(void) | 1333 | static 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 | ||
1342 | static int __init hvcs_module_init(void) | 1341 | static int __init hvcs_module_init(void) |