OSDN Git Service

i40e: Fix uninitialized variable mfs_max
authorColin Ian King <colin.king@canonical.com>
Mon, 15 Feb 2021 16:11:39 +0000 (16:11 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Feb 2021 23:21:46 +0000 (15:21 -0800)
The variable mfs_max is not initialized and is being compared to find
the maximum value. Fix this by initializing it to 0.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 90bc8e003be2 ("i40e: Add hardware configuration for software based DCB")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/i40e/i40e_dcb.c

index 7b73a27..243b0d2 100644 (file)
@@ -1636,7 +1636,7 @@ void i40e_dcb_hw_calculate_pool_sizes(struct i40e_hw *hw,
        u32 total_pool_size = 0;
        int shared_pool_size; /* Need signed variable */
        u32 port_pb_size;
-       u32 mfs_max;
+       u32 mfs_max = 0;
        u32 pcirtt;
        u8 i;