Skip to content

Commit

Permalink
bus/dpaa: fix build with asserts for GCC 13
Browse files Browse the repository at this point in the history
[ upstream commit 3bcd5b3198d4a31176b1ac73fc7236a12186fffe ]

when RTE_ENABLE_ASSERT is enable, DPAA driver is doing
wrong NULL check on frame queue which allows the code
to have access to NULL address.
GCC v13 is giving array bounds error if code is
accessing any memory region less than 4KB.
This patch fixes this issue by adding proper NULL checks
on frame queue.

Bugzilla ID: 1233
Fixes: c47ff04 ("bus/dpaa: add QMAN driver core routines")

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
  • Loading branch information
Gagandeep Singh authored and kevintraynor committed Oct 31, 2023
1 parent 81b71fc commit 171c6bf
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/bus/dpaa/base/qbman/qman.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: (BSD-3-Clause OR GPL-2.0)
*
* Copyright 2008-2016 Freescale Semiconductor Inc.
* Copyright 2017,2019 NXP
* Copyright 2017,2019-2023 NXP
*
*/

Expand Down Expand Up @@ -897,7 +897,7 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is)
/* Lookup in the retirement table */
fq = table_find_fq(p,
be32_to_cpu(msg->fq.fqid));
DPAA_BUG_ON(!fq);
DPAA_BUG_ON(fq != NULL);
fq_state_change(p, fq, &swapped_msg, verb);
if (fq->cb.fqs)
fq->cb.fqs(p, fq, &swapped_msg);
Expand All @@ -909,6 +909,7 @@ static u32 __poll_portal_slow(struct qman_portal *p, u32 is)
#else
fq = (void *)(uintptr_t)msg->fq.contextB;
#endif
DPAA_BUG_ON(fq != NULL);
fq_state_change(p, fq, msg, verb);
if (fq->cb.fqs)
fq->cb.fqs(p, fq, &swapped_msg);
Expand Down

0 comments on commit 171c6bf

Please sign in to comment.