Skip to content

Commit 457eafc

Browse files
rmullickkeith-packard
authored andcommitted
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: Rakib Mullick <rakib.mullick@gmail.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
1 parent 9a10f40 commit 457eafc

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/gpu/drm/i915/i915_gem.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3512,9 +3512,11 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data,
35123512
* so emit a request to do so.
35133513
*/
35143514
request = kzalloc(sizeof(*request), GFP_KERNEL);
3515-
if (request)
3515+
if (request) {
35163516
ret = i915_add_request(obj->ring, NULL, request);
3517-
else
3517+
if (ret)
3518+
kfree(request);
3519+
} else
35183520
ret = -ENOMEM;
35193521
}
35203522

0 commit comments

Comments
 (0)