linux/drivers/net/ethernet/qlogic/qed
Daniil Tatianin 1a9dc5610e qed/qed_dev: guard against a possible division by zero
Previously we would divide total_left_rate by zero if num_vports
happened to be 1 because non_requested_count is calculated as
num_vports - req_count. Guard against this by validating num_vports at
the beginning and returning an error otherwise.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: bcd197c81f ("qed: Add vport WFQ configuration APIs")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230309201556.191392-1-d-tatianin@yandex-team.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2023-03-13 16:55:02 -07:00
..
Makefile
qed.h
qed_chain.c
qed_cxt.c
qed_cxt.h
qed_dbg_hsi.h
qed_dcbx.c
qed_dcbx.h
qed_debug.c qed: allow sleep in qed_mcp_trace_dump() 2023-01-04 20:32:56 -08:00
qed_debug.h
qed_dev.c qed/qed_dev: guard against a possible division by zero 2023-03-13 16:55:02 -07:00
qed_dev_api.h
qed_devlink.c qed: remove pointless call to devlink_param_driverinit_value_set() 2023-01-27 12:32:02 +00:00
qed_devlink.h
qed_fcoe.c
qed_fcoe.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_iro_hsi.h
qed_iscsi.c
qed_iscsi.h
qed_iwarp.c
qed_iwarp.h
qed_l2.c
qed_l2.h
qed_ll2.c skbuff: Introduce slab_build_skb() 2022-12-09 19:47:41 -08:00
qed_ll2.h
qed_main.c
qed_mcp.c
qed_mcp.h
qed_mfw_hsi.h
qed_mng_tlv.c
qed_nvmetcp.c
qed_nvmetcp.h
qed_nvmetcp_fw_funcs.c
qed_nvmetcp_fw_funcs.h
qed_ooo.c
qed_ooo.h
qed_ptp.c
qed_ptp.h
qed_rdma.c
qed_rdma.h
qed_reg_addr.h
qed_roce.c
qed_roce.h
qed_selftest.c
qed_selftest.h
qed_sp.h
qed_sp_commands.c
qed_spq.c
qed_sriov.c qed: fix a typo in comment 2023-01-10 18:13:22 -08:00
qed_sriov.h
qed_vf.c
qed_vf.h