Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 457eafce authored by Rakib Mullick's avatar Rakib Mullick Committed by Keith Packard
Browse files

drm, i915: Fix memory leak in i915_gem_busy_ioctl().



A call to i915_add_request() has been made in function i915_gem_busy_ioctl(). i915_add_request can fail,
so in it's exit path previously allocated memory needs to be freed.

Signed-off-by: default avatarRakib Mullick <rakib.mullick@gmail.com>
Reviewed-by: default avatarKeith Packard <keithp@keithp.com>
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent 9a10f401
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3512,9 +3512,11 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
			 * so emit a request to do so.
			 */
			request = kzalloc(sizeof(*request), GFP_KERNEL);
			if (request)
			if (request) {
				ret = i915_add_request(obj->ring, NULL, request);
			else
				if (ret)
					kfree(request);
			} else
				ret = -ENOMEM;
		}