utils: ipc: Fix deserialization of multiple fd parameters

The IPADataSerializer::deserializer attempts to optimise code paths and
remove potentially unused code where multiple File Descriptors were not
expected to be utilised.

The addition of multiple SharedFD entries in the IPC highlights this as
a bug.

Clean up the conditionals to ensure that all File Descriptors are
correctly deserialized.

Bug: https://bugs.libcamera.org/show_bug.cgi?id=205
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Tested-by: Andrey Konovalov <andrey.konovalov@linaro.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Paul Elder 2023-12-11 19:56:38 +09:00 committed by Kieran Bingham
parent 0857348887
commit 1d0d2cf67c

View file

@ -186,7 +186,7 @@ IPADataSerializer<{{param|name}}>::deserialize(
{% for param in params|with_fds %}
{%- if loop.first %}
const size_t {{param.mojom_name}}FdStart = 0;
{%- elif not loop.last %}
{%- else %}
const size_t {{param.mojom_name}}FdStart = {{loop.previtem.mojom_name}}FdStart + {{loop.previtem.mojom_name}}FdsSize;
{%- endif %}
{%- endfor %}