diff options
-rw-r--r-- | drivers/platform/x86/dell-laptop.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c index fa3ee6209572..1134119521ac 100644 --- a/drivers/platform/x86/dell-laptop.c +++ b/drivers/platform/x86/dell-laptop.c | |||
@@ -284,6 +284,7 @@ static void __init parse_da_table(const struct dmi_header *dm) | |||
284 | { | 284 | { |
285 | /* Final token is a terminator, so we don't want to copy it */ | 285 | /* Final token is a terminator, so we don't want to copy it */ |
286 | int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1; | 286 | int tokens = (dm->length-11)/sizeof(struct calling_interface_token)-1; |
287 | struct calling_interface_token *new_da_tokens; | ||
287 | struct calling_interface_structure *table = | 288 | struct calling_interface_structure *table = |
288 | container_of(dm, struct calling_interface_structure, header); | 289 | container_of(dm, struct calling_interface_structure, header); |
289 | 290 | ||
@@ -296,12 +297,13 @@ static void __init parse_da_table(const struct dmi_header *dm) | |||
296 | da_command_address = table->cmdIOAddress; | 297 | da_command_address = table->cmdIOAddress; |
297 | da_command_code = table->cmdIOCode; | 298 | da_command_code = table->cmdIOCode; |
298 | 299 | ||
299 | da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * | 300 | new_da_tokens = krealloc(da_tokens, (da_num_tokens + tokens) * |
300 | sizeof(struct calling_interface_token), | 301 | sizeof(struct calling_interface_token), |
301 | GFP_KERNEL); | 302 | GFP_KERNEL); |
302 | 303 | ||
303 | if (!da_tokens) | 304 | if (!new_da_tokens) |
304 | return; | 305 | return; |
306 | da_tokens = new_da_tokens; | ||
305 | 307 | ||
306 | memcpy(da_tokens+da_num_tokens, table->tokens, | 308 | memcpy(da_tokens+da_num_tokens, table->tokens, |
307 | sizeof(struct calling_interface_token) * tokens); | 309 | sizeof(struct calling_interface_token) * tokens); |