drm/msm: Add error handling for krealloc in metadata setup
authorYuan Chen <chenyuan@kylinos.cn>
Fri, 27 Jun 2025 02:16:43 +0000 (10:16 +0800)
committerRob Clark <robin.clark@oss.qualcomm.com>
Fri, 4 Jul 2025 18:09:43 +0000 (11:09 -0700)
commit1c8c354098ea9d4376a58c96ae6b65288a6f15d8
tree8c8fc3e5c8a5ca3b9ea7003dcb1122e73beed1f0
parent024bd19bab0843f020053793223433eb852b93a2
drm/msm: Add error handling for krealloc in metadata setup

Function msm_ioctl_gem_info_set_metadata() now checks for krealloc
failure and returns -ENOMEM, avoiding potential NULL pointer dereference.
Explicitly avoids __GFP_NOFAIL due to deadlock risks and allocation constraints.

Signed-off-by: Yuan Chen <chenyuan@kylinos.cn>
Patchwork: https://patchwork.freedesktop.org/patch/661235/
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
drivers/gpu/drm/msm/msm_drv.c