Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eth: linkdata: sxevf: Return -ENOMEM when l_xdp_rxq_reg_failed
Fix follow error with clang-19: drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:73:6: error: variable 'ret' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] 73 | if (xdp_rxq_info_reg(&ring->xdp_rxq, adapter->netdev, ring->idx, 0) < 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:96:9: note: uninitialized use occurs here 96 | return ret; | ^~~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:73:2: note: remove the 'if' if its condition is always false 73 | if (xdp_rxq_info_reg(&ring->xdp_rxq, adapter->netdev, ring->idx, 0) < 0) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 74 | LOG_ERROR_BDF("ring[%u] xdp rxq info reg failed\n",ring->idx); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 75 | goto l_xdp_rxq_reg_failed; | ~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 | } | ~ drivers/net/ethernet/linkdata/sxevf/sxevf/sxevf_rx_proc.c:35:9: note: initialize the variable 'ret' to silence this warning 35 | s32 ret; | ^ | = 0 1 error generated. Signed-off-by: WangYuli <[email protected]>
- Loading branch information