From 92b0b1d0f2453006d9c7222f0fb575f0dda559bf Mon Sep 17 00:00:00 2001 From: "chao.an" Date: Mon, 8 Mar 2021 11:34:27 +0800 Subject: [PATCH] mm/iob: iob_get_queue_count() should return the iob count Change-Id: Ief7b98589613c59754f1a4d265aaa4760ad3d209 Signed-off-by: chao.an --- mm/iob/iob_get_queue_count.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mm/iob/iob_get_queue_count.c b/mm/iob/iob_get_queue_count.c index 160d221ef58..744d3ac31b5 100644 --- a/mm/iob/iob_get_queue_count.c +++ b/mm/iob/iob_get_queue_count.c @@ -42,12 +42,16 @@ int iob_get_queue_count(FAR struct iob_queue_s *queue) { - FAR struct iob_qentry_s *qentry; + FAR struct iob_qentry_s *iobq; + FAR struct iob_s *iob; int count = 0; - for (qentry = queue->qh_head; qentry != NULL; qentry = qentry->qe_flink) + for (iobq = queue->qh_head; iobq != NULL; iobq = iobq->qe_flink) { - count++; + for (iob = iobq->qe_head; iob; iob = iob->io_flink) + { + count++; + } } return count;