From 970232e84f12f1a397414477db81c3c5ba1f4451 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 2 Oct 2018 16:02:59 -0700 Subject: [PATCH] netdev: Properly clear 'details' when iterating in NETDEV_QOS_FOR_EACH. The function comment for netdev_queue_dump_next() said that it cleared its 'detail' argument, but it didn't actually do that, which meant that details could be incorrectly carried along from one queue to the next. Reported-by: Flavio Leitner Signed-off-by: Ben Pfaff Acked-by: Eelco Chaudron Acked-by: Flavio Leitner --- lib/netdev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/netdev.c b/lib/netdev.c index 063ceb3f5b4..263db527683 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -1721,8 +1721,9 @@ bool netdev_queue_dump_next(struct netdev_queue_dump *dump, unsigned int *queue_id, struct smap *details) { - const struct netdev *netdev = dump->netdev; + smap_clear(details); + const struct netdev *netdev = dump->netdev; if (dump->error) { return false; }