tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   e609571b5ffa3528bf85292de1ceaddac342bc1c
commit: b02e5a0ebb172c8276cea3151942aac681f7a4a6 xsk: Propagate napi_id to XDP 
socket Rx path
config: x86_64-randconfig-m001-20210113 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <l...@intel.com>
Reported-by: Dan Carpenter <dan.carpen...@oracle.com>

New smatch warnings:
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:6580 ixgbe_setup_rx_resources() 
error: we previously assumed 'rx_ring->q_vector' could be null (see line 6550)

vim +6580 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

9247080816297de4 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c John Fastabend   
        2017-04-24  6540  int ixgbe_setup_rx_resources(struct ixgbe_adapter 
*adapter,
9247080816297de4 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c John Fastabend   
        2017-04-24  6541                             struct ixgbe_ring *rx_ring)
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6542  {
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6543        struct device *dev = rx_ring->dev;
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6544        int orig_node = dev_to_node(dev);
98fa15f34cb37986 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Anshuman 
Khandual        2019-03-05  6545        int ring_node = NUMA_NO_NODE;
d0bcacd0a130974f drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Björn Töpel      
        2018-10-02  6546        int size;
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6547  
3a581073e0f9f396 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2008-08-26  6548        size = sizeof(struct ixgbe_rx_buffer) * 
rx_ring->count;
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6549  
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08 @6550        if (rx_ring->q_vector)
                                                                                
                                    ^^^^^^^^^^^^^^^^^
This code assumes "rx_ring->q_vector" can be NULL

ca8dfe2550cb3682 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Mark Rustad      
        2014-07-24  6551                ring_node = 
rx_ring->q_vector->numa_node;
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6552  
ffed21bcee7a544f drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2017-01-17  6553        rx_ring->rx_buffer_info = vmalloc_node(size, 
ring_node);
1a6c14a2c7c313c5 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2010-02-03  6554        if (!rx_ring->rx_buffer_info)
ffed21bcee7a544f drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2017-01-17  6555                rx_ring->rx_buffer_info = vmalloc(size);
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6556        if (!rx_ring->rx_buffer_info)
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6557                goto err;
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6558  
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6559        /* Round up to nearest 4K */
3a581073e0f9f396 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2008-08-26  6560        rx_ring->size = rx_ring->count * sizeof(union 
ixgbe_adv_rx_desc);
3a581073e0f9f396 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2008-08-26  6561        rx_ring->size = ALIGN(rx_ring->size, 4096);
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6562  
ca8dfe2550cb3682 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Mark Rustad      
        2014-07-24  6563        set_dev_node(dev, ring_node);
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6564        rx_ring->desc = dma_alloc_coherent(dev,
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6565                                           
rx_ring->size,
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6566                                           
&rx_ring->dma,
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6567                                           GFP_KERNEL);
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6568        set_dev_node(dev, orig_node);
de88eeeb16b164b6 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Alexander Duyck  
        2012-02-08  6569        if (!rx_ring->desc)
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6570                rx_ring->desc = dma_alloc_coherent(dev, 
rx_ring->size,
1b507730b7a9dfc0 drivers/net/ixgbe/ixgbe_main.c                Nick Nunley      
        2010-04-27  6571                                                   
&rx_ring->dma, GFP_KERNEL);
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6572        if (!rx_ring->desc)
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6573                goto err;
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6574  
3a581073e0f9f396 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2008-08-26  6575        rx_ring->next_to_clean = 0;
3a581073e0f9f396 drivers/net/ixgbe/ixgbe_main.c                Jesse Brandeburg 
        2008-08-26  6576        rx_ring->next_to_use = 0;
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6577  
99ffc5ade4e8703c drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Jesper Dangaard 
Brouer   2018-01-03  6578        /* XDP RX-queue info */
99ffc5ade4e8703c drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Jesper Dangaard 
Brouer   2018-01-03  6579        if (xdp_rxq_info_reg(&rx_ring->xdp_rxq, 
adapter->netdev,
b02e5a0ebb172c82 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Björn Töpel      
        2020-11-30 @6580                             rx_ring->queue_index, 
rx_ring->q_vector->napi.napi_id) < 0)
                                                                                
                                                                           
^^^^^^^^^^^^^^^^^
Unchecked dereference.


99ffc5ade4e8703c drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Jesper Dangaard 
Brouer   2018-01-03  6581                goto err;
99ffc5ade4e8703c drivers/net/ethernet/intel/ixgbe/ixgbe_main.c Jesper Dangaard 
Brouer   2018-01-03  6582  
9247080816297de4 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c John Fastabend   
        2017-04-24  6583        rx_ring->xdp_prog = adapter->xdp_prog;
9247080816297de4 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c John Fastabend   
        2017-04-24  6584  
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6585        return 0;
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6586  err:
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6587        vfree(rx_ring->rx_buffer_info);
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6588        rx_ring->rx_buffer_info = NULL;
b6ec895ecd32c007 drivers/net/ixgbe/ixgbe_main.c                Alexander Duyck  
        2010-11-16  6589        dev_err(dev, "Unable to allocate memory for the 
Rx descriptor ring\n");
177db6ffd0599430 drivers/net/ixgbe/ixgbe_main.c                Mallikarjuna R 
Chilakala 2008-06-18  6590        return -ENOMEM;
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6591  }
9a799d71034c4e2b drivers/net/ixgbe/ixgbe_main.c                Auke Kok         
        2007-09-15  6592  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org

Attachment: .config.gz
Description: application/gzip

Reply via email to