From: Bruce Allan Date: Wed, 10 Feb 2016 22:45:47 +0000 (-0800) Subject: fm10k: prevent possibly uninitialized variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c4114e3db6429c665adc3db871685c474a467efe;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Tested-by: Krishneil Singh Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c index c67121cc7b23..2e4ea8861852 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_ethtool.c @@ -937,7 +937,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)