msm: vidc: Check validity of a timestamp before inserting it to list

In steady state, the first entry in the linked list of timestamps is
always invalid. When adding a new timestamp entry, adding the
timestamp which is a duplicate of first entry leads to duplicate
linked list nodes. To avoid this, check for validity of an entry
before inserting duplicates to the linked list.

Change-Id: I47dd8fb06b9e4eb307605df6b0e2b352a2e263fe
Signed-off-by: Mihir Ganu <mganu@codeaurora.org>
This commit is contained in:
Mihir Ganu 2020-07-17 11:20:00 -07:00
commit 6b73bf247d

View file

@ -7602,7 +7602,7 @@ int msm_comm_store_timestamp(struct msm_vidc_inst *inst, u64 timestamp_us)
duplicate = NULL;
list_for_each_entry(node, &inst->timestamps.list, list) {
count++;
if (node->timestamp_us == timestamp_us)
if (node->is_valid && node->timestamp_us == timestamp_us)
duplicate = node;
}