⬢ DragonFlyBSD Kernel Audit
DF-3634 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/i915/i915_gem.c
+++ b/sys/dev/drm/i915/i915_gem.c
@@ -1958,8 +1958,10 @@
 	}
 
 #ifdef __DragonFly__
-	if (args->size == 0)
-		goto out;
+	if (args->size == 0) {
+		i915_gem_object_put(obj);
+		return (-EINVAL);
+	}
 
 	size = round_page(args->size);
 	if (map->size + size > p->p_rlimit[RLIMIT_VMEM].rlim_cur) {