Re: [1/7] cpufreq: ap806: Checking implementation of armada_8k_cpufreq_init()

From: Markus Elfring
Date: Tue Apr 02 2019 - 09:54:51 EST


> @@ -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