mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/msm/gem: Validate lazy VM in GEM_NEW
Otherwise creating a _NO_SHARE BO before any BOs are mapped could cause a NPE. Reported-by: Sashiko <sashiko-bot@kernel.org> Signed-off-by: Rob Clark <robin.clark@oss.qualcomm.com> Patchwork: https://patchwork.freedesktop.org/patch/743104/ Message-ID: <20260729155609.20190-14-robin.clark@oss.qualcomm.com>
This commit is contained in:
parent
df68029e63
commit
a6d87a272b
|
|
@ -1140,9 +1140,13 @@ int msm_gem_new_handle(struct drm_device *dev, struct drm_file *file,
|
|||
int ret;
|
||||
|
||||
if (flags & MSM_BO_NO_SHARE) {
|
||||
struct msm_drm_private *priv = dev->dev_private;
|
||||
struct msm_context *ctx = file->driver_priv;
|
||||
struct drm_gpuvm *vm = msm_context_vm(dev, ctx);
|
||||
|
||||
if (!priv->gpu || !vm)
|
||||
return UERR(EINVAL, dev, "not supported with shared VM");
|
||||
|
||||
r_obj = drm_gpuvm_resv_obj(vm);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user