mirror of https://gitee.com/openkylin/linux.git
14b84e8654
gcc warns about qed_fill_link possibly accessing uninitialized data: drivers/net/ethernet/qlogic/qed/qed_main.c: In function 'qed_fill_link': drivers/net/ethernet/qlogic/qed/qed_main.c:1170:35: error: 'link_caps' may be used uninitialized in this function [-Werror=maybe-uninitialized] While this warning is only about the specific case of CONFIG_QED_SRIOV being disabled but the function getting called for a VF (which should never happen), another possibility is that qed_mcp_get_*() fails without returning data. This rearranges the code so we bail out in either of the two cases and print a warning instead of accessing the uninitialized data. The qed_link_output structure remains untouched in this case, but all callers first call memset() on it, so at least we are not leaking stack data then. As discussed, we also use a compile-time check to ensure we never use any of the VF code if CONFIG_QED_SRIOV is disabled, and the PCI device table is updated to no longer bind to virtual functions in that configuration. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Yuval Mintz <Yuval.Mintz@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
Makefile | ||
qed.h | ||
qed_cxt.c | ||
qed_cxt.h | ||
qed_dcbx.c | ||
qed_dcbx.h | ||
qed_dev.c | ||
qed_dev_api.h | ||
qed_hsi.h | ||
qed_hw.c | ||
qed_hw.h | ||
qed_init_fw_funcs.c | ||
qed_init_ops.c | ||
qed_init_ops.h | ||
qed_int.c | ||
qed_int.h | ||
qed_l2.c | ||
qed_l2.h | ||
qed_main.c | ||
qed_mcp.c | ||
qed_mcp.h | ||
qed_reg_addr.h | ||
qed_selftest.c | ||
qed_selftest.h | ||
qed_sp.h | ||
qed_sp_commands.c | ||
qed_spq.c | ||
qed_sriov.c | ||
qed_sriov.h | ||
qed_vf.c | ||
qed_vf.h |