]> git.baikalelectronics.ru Git - kernel.git/commit
linux/dim: Do nothing if no time delta between samples
authorRoy Novich <royno@nvidia.com>
Sun, 7 May 2023 13:57:43 +0000 (16:57 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:01 +0000 (12:44 +0100)
commit7dff1b335553e9c702633c7c1f210e65ad9e1bf6
tree89f574280a2401257a819f0b46cc17df2ecefa0e
parenta7bcce821ac60ccb40fdb29b255f94da4111e094
linux/dim: Do nothing if no time delta between samples

[ Upstream commit 162bd18eb55adf464a0fa2b4144b8d61c75ff7c2 ]

Add return value for dim_calc_stats. This is an indication for the
caller if curr_stats was assigned by the function. Avoid using
curr_stats uninitialized over {rdma/net}_dim, when no time delta between
samples. Coverity reported this potential use of an uninitialized
variable.

Fixes: d28cee41da7e ("net/mlx5e: Move dynamic interrupt coalescing code to include/linux")
Fixes: 4f105e5ffd1d ("net/mlx5e: Support adaptive RX coalescing")
Signed-off-by: Roy Novich <royno@nvidia.com>
Reviewed-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Reviewed-by: Michal Kubiak <michal.kubiak@intel.com>
Link: https://lore.kernel.org/r/20230507135743.138993-1-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/linux/dim.h
lib/dim/dim.c
lib/dim/net_dim.c
lib/dim/rdma_dim.c