On Sat, 13 Jul 2019 00:39:47 +0800
Xiao Zhang <xiao.zh...@intel.com> wrote:

> This patch tries to fix the coverity issues of dereference after null
> check.
> 
> Coverity issue: 343452
> Coverity issue: 343447
> Coverity issue: 343422
> Coverity issue: 343416
> Coverity issue: 343407
> Coverity issue: 343403
> Coverity issue: 13245
> 
> Signed-off-by: Xiao Zhang <xiao.zh...@intel.com>

I think this should be fixed deeper in the vector code.

Example for ixgbe.


static inline uint16_t
reassemble_packets(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_bufs,
                   uint16_t nb_bufs, uint8_t *split_flags)
{
        struct rte_mbuf *pkts[nb_bufs]; /*finished pkts*/
        struct rte_mbuf *start = rxq->pkt_first_seg;

So start is rxq->pkt_first_seg.

But caller has already checked for NULL here.
It has iterated across the first packets but not updated rxq->first_seg.

        if (rxq->pkt_first_seg == NULL) {
                /* find the first split flag, and only reassemble then*/
                while (i < nb_bufs && !split_flags[i])
                        i++;
                if (i == nb_bufs)
                        return nb_bufs;
        }
        return i + reassemble_packets(rxq, &rx_pkts[i], nb_bufs - i,

Reply via email to