From 1d0d2cf67cb7100cfc7a368347271f88365b0a52 Mon Sep 17 00:00:00 2001 From: Paul Elder Date: Mon, 11 Dec 2023 19:56:38 +0900 Subject: 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 Tested-by: Andrey Konovalov Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- utils/ipc/generators/libcamera_templates/proxy_functions.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'utils/ipc') diff --git a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl index 2be65d43..b5797b14 100644 --- a/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl +++ b/utils/ipc/generators/libcamera_templates/proxy_functions.tmpl @@ -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 %} -- cgit v1.2.1