Messages in this thread | | | Subject | Re: [1/7] cpufreq: ap806: Checking implementation of armada_8k_cpufreq_init() | From | Markus Elfring <> | Date | Tue, 2 Apr 2019 15:54:27 +0200 |
| |
> @@ -132,6 +132,7 @@ static int __init armada_8k_cpufreq_init(void) > of_node_put(node); > return -ENODEV; > } > + of_node_put(node); > > nb_cpus = num_possible_cpus(); > freq_tables = kcalloc(nb_cpus, sizeof(*freq_tables), GFP_KERNEL);
Would another null pointer check be safer for this memory allocation? https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/drivers/cpufreq/armada-8k-cpufreq.c?id=05d08e2995cbe6efdb993482ee0d38a77040861a#n137
Regards, Markus
| |