diff options
author | Saeed Mahameed <saeedm@nvidia.com> | 2021-11-03 14:01:05 -0700 |
---|---|---|
committer | Saeed Mahameed <saeedm@nvidia.com> | 2021-11-16 20:31:47 -0800 |
commit | aef0f8c67d752ed68cc18582711ac6accf0ad9b6 (patch) | |
tree | cfb8e672f255852e3f37b7a50e22c1b5b98d8647 /drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | |
parent | net/mlx5e: Support ethtool cq mode (diff) | |
download | linux-dev-aef0f8c67d752ed68cc18582711ac6accf0ad9b6.tar.xz linux-dev-aef0f8c67d752ed68cc18582711ac6accf0ad9b6.zip |
net/mlx5: Fix format-security build warnings
Treat the string as an argument to avoid this.
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c:482:5:
error: format string is not a string literal (potentially insecure)
name);
^~~~
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:2079:4:
error: format string is not a string literal (potentially insecure)
ptp_ch_stats_desc[i].format);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Reviewed-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx5/core/en_stats.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c index 2a9bfc3ffa2e..3c91a11e27ad 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_stats.c @@ -2076,7 +2076,7 @@ static MLX5E_DECLARE_STATS_GRP_OP_FILL_STRS(ptp) for (i = 0; i < NUM_PTP_CH_STATS; i++) sprintf(data + (idx++) * ETH_GSTRING_LEN, - ptp_ch_stats_desc[i].format); + "%s", ptp_ch_stats_desc[i].format); if (priv->tx_ptp_opened) { for (tc = 0; tc < priv->max_opened_tc; tc++) |