]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Check device memory pointer before usage
authorStav Aviram <saviram@nvidia.com>
Tue, 1 Jul 2025 12:08:12 +0000 (15:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:04:57 +0000 (12:04 +0200)
commiteebb225fe6c9103293807b8edabcbad59f9589bc
tree405cb66625b2dd229d3122fbe9428fe9f6279149
parent4157321b0acfebdb65a3d4a8fd19fc9c5eb9ea1d
net/mlx5: Check device memory pointer before usage

[ Upstream commit 70f238c902b8c0461ae6fbb8d1a0bbddc4350eea ]

Add a NULL check before accessing device memory to prevent a crash if
dev->dm allocation in mlx5_init_once() fails.

Fixes: c9b9dcb430b3 ("net/mlx5: Move device memory management to mlx5_core")
Signed-off-by: Stav Aviram <saviram@nvidia.com>
Link: https://patch.msgid.link/c88711327f4d74d5cebc730dc629607e989ca187.1751370035.git.leon@kernel.org
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/hw/mlx5/dm.c
drivers/net/ethernet/mellanox/mlx5/core/lib/dm.c
drivers/net/ethernet/mellanox/mlx5/core/main.c