]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Fix potential null pointer dereference
authorGustavo A. R. Silva <gustavoars@kernel.org>
Fri, 25 Sep 2020 16:49:13 +0000 (11:49 -0500)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 1 Oct 2020 04:26:31 +0000 (21:26 -0700)
commit6acd8415989ecf55874f7a446c3fab468bdf8386
tree61e2957826d78530fe8e8aa6963c1ed79b02f46a
parent96d12a3d6f669eba3ed676f59c366749ec706593
net/mlx5e: Fix potential null pointer dereference

Calls to kzalloc() and kvzalloc() should be null-checked
in order to avoid any potential failures. In this case,
a potential null pointer dereference.

Fix this by adding null checks for _parse_attr_ and _flow_
right after allocation.

Addresses-Coverity-ID: 1497154 ("Dereference before null check")
Fixes: a650fb5166d6 ("net/mlx5: Refactor tc flow attributes structure")
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c