]> 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:08:46 +0000 (12:08 +0200)
commit62d7cf455c887941ed6f105cd430ba04ee0b6c9f
tree7143a63d020e00fffe1f7c4a67ea4bd49bc84a87
parentc45a33903e2484a11234a7ab47593615ed4a1be7
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