diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 1976244b97e3..3759d0a15c7b 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -1126,10 +1126,9 @@ static inline int parse_perf_domain(int cpu, const char *list_name, const char *cell_name, struct of_phandle_args *args) { - struct device_node *cpu_np; int ret; - cpu_np = of_cpu_device_node_get(cpu); + struct device_node *cpu_np __free(device_node) = of_cpu_device_node_get(cpu); if (!cpu_np) return -ENODEV; @@ -1137,9 +1136,6 @@ static inline int parse_perf_domain(int cpu, const char *list_name, args); if (ret < 0) return ret; - - of_node_put(cpu_np); - return 0; }