]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Fix uininitialized pointer read on pointer attr
authorColin Ian King <colin.king@canonical.com>
Tue, 6 Oct 2020 18:12:43 +0000 (19:12 +0100)
committerSaeed Mahameed <saeedm@nvidia.com>
Mon, 12 Oct 2020 22:37:44 +0000 (15:37 -0700)
commiteebd078e27dd85bdd841caa866ee02531eb4c73d
tree1880dbc28c3fcdebc719fe14b6dc31065586212d
parentd2030de9420a74281b835b6aa4ce7a375b6e7e0d
net/mlx5: Fix uininitialized pointer read on pointer attr

Currently the error exit path err_free kfree's attr. In the case where
flow and parse_attr failed to be allocated this return path will free
the uninitialized pointer attr, which is not correct.  In the other
case where attr fails to allocate attr does not need to be freed. So
in both error exits via err_free attr should not be freed, so remove
it.

Addresses-Coverity: ("Uninitialized pointer read")
Fixes: 6acd8415989e ("net/mlx5e: Fix potential null pointer dereference")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c