Hello Michal Kubiak,

Commit 93f53db9f9dc ("ice: switch to Page Pool") from Sep 25, 2025
(linux-next), leads to the following Smatch static checker warning:

        drivers/net/ethernet/intel/ice/ice_xsk.c:203 ice_xsk_pool_setup()
        warn: potential bounds check after use 'qid'

drivers/net/ethernet/intel/ice/ice_xsk.c
    197 int ice_xsk_pool_setup(struct ice_vsi *vsi, struct xsk_buff_pool *pool, 
u16 qid)
    198 {
    199         struct ice_rx_ring *rx_ring = vsi->rx_rings[qid];
                                              ^^^^^^^^^^^^^^^^^^
This looks like potentially an out of bounds read.

    200         bool if_running, pool_present = !!pool;
    201         int ret = 0, pool_failure = 0;
    202 
--> 203         if (qid >= vsi->num_rxq || qid >= vsi->num_txq) {
                    ^^^^^^^^^^^^^^^^^^^
qid is checked here but it's too late.

    204                 netdev_err(vsi->netdev, "Please use queue id in scope 
of combined queues count\n");
    205                 pool_failure = -EINVAL;
    206                 goto failure;
    207         }

This email is a free service from the Smatch-CI project [smatch.sf.net].

regards,
dan carpenter

Reply via email to