Re: [PATCH 02/10] of: Correct return value for API of_parse_phandle_with_args_map()

From: Rob Herring
Date: Mon Dec 09 2024 - 08:33:17 EST


On Thu, Dec 5, 2024 at 6:53 PM Zijun Hu <zijun_hu@xxxxxxxxxx> wrote:
>
> From: Zijun Hu <quic_zijuhu@xxxxxxxxxxx>
>
> @ret is used by of_parse_phandle_with_args_map() to record return value
> and it is preseted with -EINVAL before the outer while loop, but it is
> changed to 0 by below successful operation within the inner loop:
> of_property_read_u32(new, cells_name, &new_size)
>
> So cause 0(success) is returned for all failures which happen after the
> operation, that is obviously wrong.
>
> Fix by restoring @ret with preseted -EINVAL after the operation.

Already have a similar fix queued up.

Rob