Skip to contentSkip to conversation

devargs: backup entry when inserting duplicated item

PATCH Applied Xueming Li 2 participants 2 messages Apr 17, 2021 – Apr 19, 2021

lore
Share & tools
lore

Xueming Li

author
#0 lore raw

PATCH 1/1 devargs: backup entry when inserting duplicated item

When insert devargs that already in list, existing one was reset and replaced completely by new once, the entry info was lost during copy.

This patch backups entry info before copy.

Fixes 64051bb1f144 ("devargs: unify scratch buffer storage")
---
 lib/librte_eal/common/eal_common_devargs.c | 1 +
 1 file changed, 1 insertion(+)
lib/librte_eal/common/eal_common_devargs.c +1 -0
index e40b91ea66..96e0456d20 100644
@@ -295,6 +295,7 @@ rte_devargs_insert(struct rte_devargs **da)
 		if (strcmp(listed_da->bus->name, (*da)->bus->name) == 0 &&
 				strcmp(listed_da->name, (*da)->name) == 0) {
 			/* device already in devargs list, must be updated */
+			(*da)->next = listed_da->next;
 			rte_devargs_reset(listed_da);
 			*listed_da = **da;
 			/* replace provided devargs with found one */
Signature · 1 line
2.25.1
#1 lore raw

17/04/2021 17:15, Xueming Li:

Quoted 7 lines

When insert devargs that already in list, existing one was reset and replaced completely by new once, the entry info was lost during copy.

This patch backups entry info before copy.

Fixes 64051bb1f144 ("devargs: unify scratch buffer storage")
Quoted 1 line

Applied, thanks