Skip to contentSkip to conversation

drm/nouveau/svm: fail NOUVEAU_SVM_INIT ioctl on unsupported devices

PATCH New Karol Herbst 1 participant 1 message Jan 18, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/nouveau/svm: fail NOUVEAU_SVM_INIT ioctl on unsupported devices

Fixes a crash when trying to create a channel on e.g. Turing GPUs when NOUVEAU_SVM_INIT was called before.

Fixes eeaf06ac1a558 ("drm/nouveau/svm: initial support for shared virtual memory")
---
 drivers/gpu/drm/nouveau/nouveau_svm.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/nouveau/nouveau_svm.c +4 -0
index 4f69e4c3dafd..1c3f890377d2 100644
@@ -315,6 +315,10 @@ nouveau_svmm_init(struct drm_device *dev, void *data,
 	struct drm_nouveau_svm_init *args = data;
 	int ret;
 
+	/* We need to fail if svm is disabled */
+	if (!cli->drm->svm)
+		return -ENOSYS;
+
 	/* Allocate tracking for SVM-enabled VMM. */
 	if (!(svmm = kzalloc(sizeof(*svmm), GFP_KERNEL)))
 		return -ENOMEM;
Signature · 1 line
2.29.2