diff mbox series

i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc()

Message ID 20200916143228.GA764370@mwanda
State Under Review
Delegated to: Anthony Nguyen
Headers show
Series i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc() | expand

Commit Message

Dan Carpenter Sept. 16, 2020, 2:32 p.m. UTC
The "failure" variable is used without being initialized.  It should be
set to false.

Fixes: 8cbf74149903 ("i40e, xsk: move buffer allocation out of the Rx processing loop")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Björn Töpel Sept. 16, 2020, 3:49 p.m. UTC | #1
On 2020-09-16 16:32, Dan Carpenter wrote:
> The "failure" variable is used without being initialized.  It should be
> set to false.
> 
> Fixes: 8cbf74149903 ("i40e, xsk: move buffer allocation out of the Rx processing loop")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks Dan!

Acked-by: Björn Töpel <bjorn.topel@intel.com>

> ---
>   drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> index 6acede0acdca..567fd67e900e 100644
> --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
> @@ -281,8 +281,8 @@ int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
>   	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
>   	u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
>   	unsigned int xdp_res, xdp_xmit = 0;
> +	bool failure = false;
>   	struct sk_buff *skb;
> -	bool failure;
>   
>   	while (likely(total_rx_packets < (unsigned int)budget)) {
>   		union i40e_rx_desc *rx_desc;
>
Kuruvinakunnel, George Oct. 13, 2020, 10:26 a.m. UTC | #2
-----Original Message-----
From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of Dan Carpenter
Sent: Wednesday, September 16, 2020 8:02 PM
To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>
Cc: intel-wired-lan@lists.osuosl.org; kernel-janitors@vger.kernel.org; Topel, Bjorn <bjorn.topel@intel.com>
Subject: [Intel-wired-lan] [PATCH] i40e, xsk: uninitialized variable in i40e_clean_rx_irq_zc()



The "failure" variable is used without being initialized.  It should be set to false.



Fixes: 8cbf74149903 ("i40e, xsk: move buffer allocation out of the Rx processing loop")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com<mailto:dan.carpenter@oracle.com>>

---

drivers/net/ethernet/intel/i40e/i40e_xsk.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)



Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
index 6acede0acdca..567fd67e900e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c
@@ -281,8 +281,8 @@  int i40e_clean_rx_irq_zc(struct i40e_ring *rx_ring, int budget)
 	unsigned int total_rx_bytes = 0, total_rx_packets = 0;
 	u16 cleaned_count = I40E_DESC_UNUSED(rx_ring);
 	unsigned int xdp_res, xdp_xmit = 0;
+	bool failure = false;
 	struct sk_buff *skb;
-	bool failure;
 
 	while (likely(total_rx_packets < (unsigned int)budget)) {
 		union i40e_rx_desc *rx_desc;