devargs: backup entry when inserting duplicated item
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")
Signed-off-by Xueming Li <[email protected]>
--- lib/librte_eal/common/eal_common_devargs.c | 1 + 1 file changed, 1 insertion(+)
lib/librte_eal/common/eal_common_devargs.c +1 -0
@@ -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
Thomas Monjalon
Applied17/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")
Reported-by Jim Harris <[email protected]>
Quoted 1 line
Signed-off-by Xueming Li <[email protected]>
Applied, thanks