Skip to content

Commit d6d04ee

Browse files
kubalewskianguy11
authored andcommitted
i40e: Fix sparse error: uninitialized symbol 'ring'
Init pointer with NULL in default switch case statement. Previously the error was produced when compiling against sparse. i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'. Fixes: 44ea803 ("i40e: introduce new dump desc XDP command") Signed-off-by: Aleksandr Loktionov <[email protected]> Signed-off-by: Arkadiusz Kubalewski <[email protected]> Tested-by: Dave Switzer <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent 12738ac commit d6d04ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_debugfs.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,9 @@ static void i40e_dbg_dump_desc(int cnt, int vsi_seid, int ring_id, int desc_n,
578578
case RING_TYPE_XDP:
579579
ring = kmemdup(vsi->xdp_rings[ring_id], sizeof(*ring), GFP_KERNEL);
580580
break;
581+
default:
582+
ring = NULL;
583+
break;
581584
}
582585
if (!ring)
583586
return;

0 commit comments

Comments
 (0)