From: Stephen Hemminger <[email protected]>

The conversion loop is bounded only by num, which is not checked
unless RTE_LIBRTE_DPAA_HWDEBUG is set. GCC on ppc64le and riscv
therefore warns that bm_bufs[0] may be read uninitialized when
copying the first entry into the RCR.

Convert entry 0 unconditionally, as bman_release() does.

Fixes: e55e2e2d0c66 ("bus/dpaa: optimize DPAA multi-entry buffer pool 
operations")
Cc: [email protected]

Signed-off-by: Gagandeep Singh <[email protected]>
Signed-off-by: Stephen Hemminger <[email protected]>
---
 drivers/bus/dpaa/base/qbman/bman.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/dpaa/base/qbman/bman.c 
b/drivers/bus/dpaa/base/qbman/bman.c
index 2b081cb78a..76e612662f 100644
--- a/drivers/bus/dpaa/base/qbman/bman.c
+++ b/drivers/bus/dpaa/base/qbman/bman.c
@@ -279,7 +279,8 @@ bman_release_fast(struct bman_pool *pool, const uint64_t 
*bufs,
        if (unlikely(!r))
                return -EBUSY;
 
-       for (i = 0; i < num; i++)
+       bm_buffer_set64_to_be(&bm_bufs[0], bufs[0]);
+       for (i = 1; i < num; i++)
                bm_buffer_set64_to_be(&bm_bufs[i], bufs[i]);
 
        /* bufs[0] overlaps the verb, which bm_rcr_pvb_commit() writes last
-- 
2.25.1

Reply via email to