drm/amdkfd: Fix missing check in kfd_parse_subtype_iolink
Subsystems (3)
PATCH 1/1 drm/amdkfd: Fix missing check in kfd_parse_subtype_iolink
The kmemdup() function may return NULL in case of error. Add NULL checking to prevent potential null deference.
Signed-off-by Miaoqian Lin <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +2 -0
@@ -1060,6 +1060,8 @@ static int kfd_parse_subtype_iolink(struct crat_subtype_iolink *iolink,return -ENODEV ;/* same everything but the other direction */ props2 =kmemdup (props,sizeof (*props2),GFP_KERNEL ); +if (!props2) +return -ENOMEM ; props2->node_from = id_to; props2->node_to = id_from; props2->kobj =NULL ;
Signature · 1 line
2.17.1