Skip to contentSkip to conversation

firmware: arm_ffa: Fix ffa_notification_info_get() IDs handling

PATCH Applied Lorenzo Pieralisi 2 participants 3 messages Nov 8, 2023 – Nov 13, 2023 Firmware framework for ARMV8-a

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 firmware: arm_ffa: Fix ffa_notification_info_get() IDs handling

To parse the retrieved ID lists appropriately in ffa_notification_info_get() the ids_processed variable should not be pre-incremented - we are dropping an identifier at the beginning of the list.

Fix it by using the post-increment operator to increment the number of processed IDs.

Fixes 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface")
Cc Sudeep Holla <[email protected]>
---
 drivers/firmware/arm_ffa/driver.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/firmware/arm_ffa/driver.c +2 -2
index 07b72c679247..ccf91a795c3d 100644
@@ -782,7 +782,7 @@ static void ffa_notification_info_get(void)
 			if (ids_processed >= max_ids - 1)
 				break;
 
-			part_id = packed_id_list[++ids_processed];
+			part_id = packed_id_list[ids_processed++];
 
 			if (!ids_count[list]) { /* Global Notification */
 				__do_sched_recv_cb(part_id, 0, false);
@@ -794,7 +794,7 @@ static void ffa_notification_info_get(void)
 				if (ids_processed >= max_ids - 1)
 					break;
 
-				vcpu_id = packed_id_list[++ids_processed];
+				vcpu_id = packed_id_list[ids_processed++];
 
 				__do_sched_recv_cb(part_id, vcpu_id, true);
 			}
Signature · 1 line
2.34.1
#1 lore raw
Quoted 9 lines · Lorenzo Pieralisi

To parse the retrieved ID lists appropriately in ffa_notification_info_get() the ids_processed variable should not be pre-incremented - we are dropping an identifier at the beginning of the list.

Fix it by using the post-increment operator to increment the number of processed IDs.

Fixes 3522be48d82b ("firmware: arm_ffa: Implement the NOTIFICATION_INFO_GET interface")

Thanks for spotting and fixing this. Much appreciated! I will queue at -rc1.

Signature · 2 lines
Regards,
Sudeep
Applied
#2 lore raw
In reply to Lorenzo Pieralisi
Quoted 9 lines · Lorenzo Pieralisi

To parse the retrieved ID lists appropriately in ffa_notification_info_get() the ids_processed variable should not be pre-incremented - we are dropping an identifier at the beginning of the list.

Fix it by using the post-increment operator to increment the number of processed IDs.

[...]

Applied to sudeep.holla/linux (for-next/ffa/fixes), thanks!

[1/1] firmware: arm_ffa: Fix ffa_notification_info_get() IDs handling

      https://git.kernel.org/sudeep.holla/c/f1ed48ef97e2

--
Regards,
Sudeep