[PATCH v1 1/1] bbdev: fix possible null pointer dereference
Maxime Coquelin
maxime.coquelin at redhat.com
Mon May 12 13:52:46 CEST 2025
On 5/2/25 12:10 AM, Nicolas Chautru wrote:
> This change addresses the CID 457446: Null pointer dereferences
> (REVERSE_INULL). Not expected to happen in practice, but the
> config may be potentially undefined through API.
>
> Coverity issue: 457446
> Fixes: 61aa25b96e14 ("bbdev: add trace points")
>
> Signed-off-by: Nicolas Chautru <nicolas.chautru at intel.com>
> ---
> lib/bbdev/rte_bbdev.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
> index f341e6f3b9..56f313ee64 100644
> --- a/lib/bbdev/rte_bbdev.c
> +++ b/lib/bbdev/rte_bbdev.c
> @@ -440,10 +440,6 @@ int
> rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
> const struct rte_bbdev_queue_conf *conf)
> {
> -
> - rte_bbdev_trace_queue_configure(dev_id, queue_id, rte_bbdev_op_type_str(conf->op_type),
> - conf->priority);
> -
> int ret = 0;
> struct rte_bbdev_driver_info dev_info;
> struct rte_bbdev *dev = get_dev(dev_id);
> @@ -451,6 +447,11 @@ rte_bbdev_queue_configure(uint16_t dev_id, uint16_t queue_id,
> struct rte_bbdev_queue_conf *stored_conf;
> const char *op_type_str;
> unsigned int max_priority;
> +
> + rte_bbdev_trace_queue_configure(dev_id, queue_id,
> + conf != NULL ? rte_bbdev_op_type_str(conf->op_type) : NULL,
> + conf != NULL ? conf->priority : 0);
> +
> VALID_DEV_OR_RET_ERR(dev, dev_id);
>
> VALID_DEV_OPS_OR_RET_ERR(dev, dev_id);
Reviewed-by: Maxime Coquelin <maxime.coquelin at redhat.com>
Thanks,
Maxime
More information about the dev
mailing list