diff options
| -rw-r--r-- | drivers/cpufreq/acpi-cpufreq.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/ia64-acpi-cpufreq.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/longhaul.c | 2 | ||||
| -rw-r--r-- | drivers/cpufreq/powernow-k8.c | 5 | ||||
| -rw-r--r-- | drivers/cpufreq/s3c24xx-cpufreq.c | 4 | ||||
| -rw-r--r-- | drivers/cpufreq/spear-cpufreq.c | 7 |
6 files changed, 9 insertions, 13 deletions
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 822ca03a87f7..c91ef5785dfa 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
| @@ -754,7 +754,7 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) | |||
| 754 | goto err_unreg; | 754 | goto err_unreg; |
| 755 | } | 755 | } |
| 756 | 756 | ||
| 757 | data->freq_table = kmalloc(sizeof(*data->freq_table) * | 757 | data->freq_table = kzalloc(sizeof(*data->freq_table) * |
| 758 | (perf->state_count+1), GFP_KERNEL); | 758 | (perf->state_count+1), GFP_KERNEL); |
| 759 | if (!data->freq_table) { | 759 | if (!data->freq_table) { |
| 760 | result = -ENOMEM; | 760 | result = -ENOMEM; |
diff --git a/drivers/cpufreq/ia64-acpi-cpufreq.c b/drivers/cpufreq/ia64-acpi-cpufreq.c index beb191b589d4..c30aaa6a54e8 100644 --- a/drivers/cpufreq/ia64-acpi-cpufreq.c +++ b/drivers/cpufreq/ia64-acpi-cpufreq.c | |||
| @@ -254,7 +254,7 @@ acpi_cpufreq_cpu_init ( | |||
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | /* alloc freq_table */ | 256 | /* alloc freq_table */ |
| 257 | data->freq_table = kmalloc(sizeof(*data->freq_table) * | 257 | data->freq_table = kzalloc(sizeof(*data->freq_table) * |
| 258 | (data->acpi_data.state_count + 1), | 258 | (data->acpi_data.state_count + 1), |
| 259 | GFP_KERNEL); | 259 | GFP_KERNEL); |
| 260 | if (!data->freq_table) { | 260 | if (!data->freq_table) { |
diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 5c440f87ba8a..d00e5d1abd25 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c | |||
| @@ -475,7 +475,7 @@ static int longhaul_get_ranges(void) | |||
| 475 | return -EINVAL; | 475 | return -EINVAL; |
| 476 | } | 476 | } |
| 477 | 477 | ||
| 478 | longhaul_table = kmalloc((numscales + 1) * sizeof(*longhaul_table), | 478 | longhaul_table = kzalloc((numscales + 1) * sizeof(*longhaul_table), |
| 479 | GFP_KERNEL); | 479 | GFP_KERNEL); |
| 480 | if (!longhaul_table) | 480 | if (!longhaul_table) |
| 481 | return -ENOMEM; | 481 | return -ENOMEM; |
diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 770a9e1b3468..1b6ae6b57c11 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c | |||
| @@ -623,7 +623,7 @@ static int fill_powernow_table(struct powernow_k8_data *data, | |||
| 623 | if (check_pst_table(data, pst, maxvid)) | 623 | if (check_pst_table(data, pst, maxvid)) |
| 624 | return -EINVAL; | 624 | return -EINVAL; |
| 625 | 625 | ||
| 626 | powernow_table = kmalloc((sizeof(*powernow_table) | 626 | powernow_table = kzalloc((sizeof(*powernow_table) |
| 627 | * (data->numps + 1)), GFP_KERNEL); | 627 | * (data->numps + 1)), GFP_KERNEL); |
| 628 | if (!powernow_table) { | 628 | if (!powernow_table) { |
| 629 | printk(KERN_ERR PFX "powernow_table memory alloc failure\n"); | 629 | printk(KERN_ERR PFX "powernow_table memory alloc failure\n"); |
| @@ -793,7 +793,7 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) | |||
| 793 | } | 793 | } |
| 794 | 794 | ||
| 795 | /* fill in data->powernow_table */ | 795 | /* fill in data->powernow_table */ |
| 796 | powernow_table = kmalloc((sizeof(*powernow_table) | 796 | powernow_table = kzalloc((sizeof(*powernow_table) |
| 797 | * (data->acpi_data.state_count + 1)), GFP_KERNEL); | 797 | * (data->acpi_data.state_count + 1)), GFP_KERNEL); |
| 798 | if (!powernow_table) { | 798 | if (!powernow_table) { |
| 799 | pr_debug("powernow_table memory alloc failure\n"); | 799 | pr_debug("powernow_table memory alloc failure\n"); |
| @@ -810,7 +810,6 @@ static int powernow_k8_cpu_init_acpi(struct powernow_k8_data *data) | |||
| 810 | 810 | ||
| 811 | powernow_table[data->acpi_data.state_count].frequency = | 811 | powernow_table[data->acpi_data.state_count].frequency = |
| 812 | CPUFREQ_TABLE_END; | 812 | CPUFREQ_TABLE_END; |
| 813 | powernow_table[data->acpi_data.state_count].driver_data = 0; | ||
| 814 | data->powernow_table = powernow_table; | 813 | data->powernow_table = powernow_table; |
| 815 | 814 | ||
| 816 | if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) | 815 | if (cpumask_first(cpu_core_mask(data->cpu)) == data->cpu) |
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index a3dc192d21f9..be1b2b5c9753 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c | |||
| @@ -586,7 +586,7 @@ static int s3c_cpufreq_build_freq(void) | |||
| 586 | size = cpu_cur.info->calc_freqtable(&cpu_cur, NULL, 0); | 586 | size = cpu_cur.info->calc_freqtable(&cpu_cur, NULL, 0); |
| 587 | size++; | 587 | size++; |
| 588 | 588 | ||
| 589 | ftab = kmalloc(sizeof(*ftab) * size, GFP_KERNEL); | 589 | ftab = kzalloc(sizeof(*ftab) * size, GFP_KERNEL); |
| 590 | if (!ftab) { | 590 | if (!ftab) { |
| 591 | printk(KERN_ERR "%s: no memory for tables\n", __func__); | 591 | printk(KERN_ERR "%s: no memory for tables\n", __func__); |
| 592 | return -ENOMEM; | 592 | return -ENOMEM; |
| @@ -664,7 +664,7 @@ int __init s3c_plltab_register(struct cpufreq_frequency_table *plls, | |||
| 664 | 664 | ||
| 665 | size = sizeof(*vals) * (plls_no + 1); | 665 | size = sizeof(*vals) * (plls_no + 1); |
| 666 | 666 | ||
| 667 | vals = kmalloc(size, GFP_KERNEL); | 667 | vals = kzalloc(size, GFP_KERNEL); |
| 668 | if (vals) { | 668 | if (vals) { |
| 669 | memcpy(vals, plls, size); | 669 | memcpy(vals, plls, size); |
| 670 | pll_reg = vals; | 670 | pll_reg = vals; |
diff --git a/drivers/cpufreq/spear-cpufreq.c b/drivers/cpufreq/spear-cpufreq.c index 4cfdcff8a310..38678396636d 100644 --- a/drivers/cpufreq/spear-cpufreq.c +++ b/drivers/cpufreq/spear-cpufreq.c | |||
| @@ -195,18 +195,15 @@ static int spear_cpufreq_probe(struct platform_device *pdev) | |||
| 195 | cnt = prop->length / sizeof(u32); | 195 | cnt = prop->length / sizeof(u32); |
| 196 | val = prop->value; | 196 | val = prop->value; |
| 197 | 197 | ||
| 198 | freq_tbl = kmalloc(sizeof(*freq_tbl) * (cnt + 1), GFP_KERNEL); | 198 | freq_tbl = kzalloc(sizeof(*freq_tbl) * (cnt + 1), GFP_KERNEL); |
| 199 | if (!freq_tbl) { | 199 | if (!freq_tbl) { |
| 200 | ret = -ENOMEM; | 200 | ret = -ENOMEM; |
| 201 | goto out_put_node; | 201 | goto out_put_node; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | for (i = 0; i < cnt; i++) { | 204 | for (i = 0; i < cnt; i++) |
| 205 | freq_tbl[i].driver_data = i; | ||
| 206 | freq_tbl[i].frequency = be32_to_cpup(val++); | 205 | freq_tbl[i].frequency = be32_to_cpup(val++); |
| 207 | } | ||
| 208 | 206 | ||
| 209 | freq_tbl[i].driver_data = i; | ||
| 210 | freq_tbl[i].frequency = CPUFREQ_TABLE_END; | 207 | freq_tbl[i].frequency = CPUFREQ_TABLE_END; |
| 211 | 208 | ||
| 212 | spear_cpufreq.freq_tbl = freq_tbl; | 209 | spear_cpufreq.freq_tbl = freq_tbl; |
