Skip to content
Commit 29d82b36 authored by Kunwu Chan's avatar Kunwu Chan Committed by Greg Kroah-Hartman
Browse files

platform/mellanox: Add null pointer checks for devm_kasprintf()



[ Upstream commit 2c7c857f ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Compile-tested only.

Fixes: 1a218d31 ("platform/mellanox: mlxbf-pmc: Add Mellanox BlueField PMC driver")
Suggested-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Suggested-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Reviewed-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Link: https://lore.kernel.org/r/20231201055447.2356001-1-chentao@kylinos.cn


[ij: split the change into two]
Reviewed-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 646f1e9c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment