[Intel-wired-lan] [PATCH 2/6] fm10k: prevent possibly uninitialized variable

Jacob Keller jacob.e.keller at intel.com
Wed Feb 10 22:45:47 UTC 2016


From: Bruce Allan <bruce.w.allan at intel.com>

If 'attr_flag < (1 << (2 * FM10K_TEST_MSG_NESTED))' is ever false, err
will be used uninitialized.

Signed-off-by: Bruce Allan <bruce.w.allan at intel.com>
---
This is a direct copy of a patch authored by Bruce from our out of
tree driver, hence the authorship and signed-off-by.

 drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
index 7a959713daa3..0168ca6fcdff 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c
@@ -1005,7 +1005,7 @@ static int fm10k_mbx_test(struct fm10k_intfc *interface, u64 *data)
 	struct fm10k_mbx_info *mbx = &hw->mbx;
 	u32 attr_flag, test_msg[6];
 	unsigned long timeout;
-	int err;
+	int err = -EINVAL;
 
 	/* For now this is a VF only feature */
 	if (hw->mac.type != fm10k_mac_vf)
-- 
2.7.0.236.gda096a0.dirty



More information about the Intel-wired-lan mailing list