diff options
author | Andrzej Hajda <a.hajda@samsung.com> | 2015-08-07 03:59:17 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-09-01 09:51:15 -0400 |
commit | a482e5562e48d89ea50f41f9fc6ed3a9768de2ff (patch) | |
tree | ecc0393b41e96e72b05ee394e7582c98e7a4dd7b | |
parent | 36dfef23cd26a6d3b71dd86509e34d311f1cd906 (diff) |
cpufreq: sfi: use kmemdup rather than duplicating its implementation
The patch was generated using fixed coccinelle semantic patch
scripts/coccinelle/api/memdup.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2014320
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | drivers/cpufreq/sfi-cpufreq.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/cpufreq/sfi-cpufreq.c b/drivers/cpufreq/sfi-cpufreq.c index ffa3389e535b..992ce6f9abec 100644 --- a/drivers/cpufreq/sfi-cpufreq.c +++ b/drivers/cpufreq/sfi-cpufreq.c | |||
@@ -45,12 +45,10 @@ static int sfi_parse_freq(struct sfi_table_header *table) | |||
45 | pentry = (struct sfi_freq_table_entry *)sb->pentry; | 45 | pentry = (struct sfi_freq_table_entry *)sb->pentry; |
46 | totallen = num_freq_table_entries * sizeof(*pentry); | 46 | totallen = num_freq_table_entries * sizeof(*pentry); |
47 | 47 | ||
48 | sfi_cpufreq_array = kzalloc(totallen, GFP_KERNEL); | 48 | sfi_cpufreq_array = kmemdup(pentry, totallen, GFP_KERNEL); |
49 | if (!sfi_cpufreq_array) | 49 | if (!sfi_cpufreq_array) |
50 | return -ENOMEM; | 50 | return -ENOMEM; |
51 | 51 | ||
52 | memcpy(sfi_cpufreq_array, pentry, totallen); | ||
53 | |||
54 | return 0; | 52 | return 0; |
55 | } | 53 | } |
56 | 54 | ||