]> Gentwo Git Trees - linux/.git/commit
drm/msm: Add NULL check in vm_op_enqueue()
authorGopi Krishna Menon <krishnagopi487@gmail.com>
Sat, 4 Oct 2025 11:00:04 +0000 (16:30 +0530)
committerRob Clark <robin.clark@oss.qualcomm.com>
Sat, 15 Nov 2025 17:10:44 +0000 (09:10 -0800)
commit89194773f5738a0617240ac92b190fbd553e58bc
tree5eea655ccc3ad6662456f3fd214f51566768e2f0
parente2f085ab8636fae2ebe0adf42071e7558234cd7b
drm/msm: Add NULL check in vm_op_enqueue()

vm_op_enqueue() allocates an msm_vm_op struct with kmalloc,
but the return value is not checked for NULL value which
can be returned by kmalloc under low-memory conditions.
This can result in NULL pointer dereference when the pointer
is dereferenced.

Add NULL check after the allocation and propagate -ENOMEM back
to the caller in case of a failure.

Signed-off-by: Gopi Krishna Menon <krishnagopi487@gmail.com>
Patchwork: https://patchwork.freedesktop.org/patch/678416/
Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com>
drivers/gpu/drm/msm/msm_gem_vma.c