Skip to content

Commit c4114e3

Browse files
bwallanJeff Kirsher
authored andcommitted
fm10k: prevent possibly uninitialized variable
If 'attr_flag < (1 << (2 * FM10K_TEST_MSG_NESTED))' is ever false, err will be used uninitialized. Signed-off-by: Bruce Allan <[email protected]> Tested-by: Krishneil Singh <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent d2e0721 commit c4114e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ static int fm10k_mbx_test(struct fm10k_intfc *interface, u64 *data)
937937
struct fm10k_mbx_info *mbx = &hw->mbx;
938938
u32 attr_flag, test_msg[6];
939939
unsigned long timeout;
940-
int err;
940+
int err = -EINVAL;
941941

942942
/* For now this is a VF only feature */
943943
if (hw->mac.type != fm10k_mac_vf)

0 commit comments

Comments
 (0)