diff options
| -rw-r--r-- | arch/x86/platform/intel-mid/sfi.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/platform/intel-mid/sfi.c b/arch/x86/platform/intel-mid/sfi.c index ce992e8cc065..5ee360a951ce 100644 --- a/arch/x86/platform/intel-mid/sfi.c +++ b/arch/x86/platform/intel-mid/sfi.c | |||
| @@ -197,10 +197,9 @@ static int __init sfi_parse_gpio(struct sfi_table_header *table) | |||
| 197 | num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry); | 197 | num = SFI_GET_NUM_ENTRIES(sb, struct sfi_gpio_table_entry); |
| 198 | pentry = (struct sfi_gpio_table_entry *)sb->pentry; | 198 | pentry = (struct sfi_gpio_table_entry *)sb->pentry; |
| 199 | 199 | ||
| 200 | gpio_table = kmalloc(num * sizeof(*pentry), GFP_KERNEL); | 200 | gpio_table = kmemdup(pentry, num * sizeof(*pentry), GFP_KERNEL); |
| 201 | if (!gpio_table) | 201 | if (!gpio_table) |
| 202 | return -1; | 202 | return -1; |
| 203 | memcpy(gpio_table, pentry, num * sizeof(*pentry)); | ||
| 204 | gpio_num_entry = num; | 203 | gpio_num_entry = num; |
| 205 | 204 | ||
| 206 | pr_debug("GPIO pin info:\n"); | 205 | pr_debug("GPIO pin info:\n"); |
