From e4b5b2ba9c10b969f8d5dc91b1ddbf50ee621a66 Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Sat, 17 Apr 2021 23:15:32 +0800 Subject: [PATCH] devargs: fix list entry update When inserting devargs that is already in list, existing one was reset and replaced completely by new one, 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 Signed-off-by: Xueming Li --- lib/librte_eal/common/eal_common_devargs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c index 4b5be80328..b31ac879a9 100644 --- a/lib/librte_eal/common/eal_common_devargs.c +++ b/lib/librte_eal/common/eal_common_devargs.c @@ -298,6 +298,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 */ -- 2.20.1