Re: [PATCH 2/4] cpuidle: riscv-sbi: Use scoped device node handling to simplify error paths

Krzysztof Kozlowski
2024-08-20T09:29:12Z

On 19/08/2024 18:13, Jonathan Cameron wrote:
>>
>> /* Parse SBI specific details from state DT nodes */
>> for (i = 1; i < state_count; i++) {
>> @@ -264,10 +262,8 @@ static int sbi_cpuidle_dt_init_states(struct device *dev,
>>
>> pr_debug("sbi-state %#x index %d\n", states[i], i);
>> }
>> - if (i != state_count) {
>> - ret = -ENODEV;
>> - goto fail;
>> - }
>> + if (i != state_count)
>> + return -ENODEV;
>>
>> /* Initialize optional data, used for the hierarchical topology. */
>> ret = sbi_dt_cpu_init_topology(drv, data, state_count, cpu);
> The handling of error ret from here doesn't free the node.
>
> Bug or something subtle I'm missing?
>
> If it's a bug, then fixes tag.

Yeah, indeed it is a fix.

Best regards,
Krzysztof