Skip to content

Commit 64387b6

Browse files
committed
drm/i915: Protect against leaks in pipe_crc_set_source
Stupid userspace (there is no evil userspace in debugfs by assumption) might provoke a leak since we allocate the new array without holding any locks. Drop in an unconditional kfree to deal with this - kfree can handle NULL. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
1 parent 9ad6d99 commit 64387b6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/gpu/drm/i915/i915_debugfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3433,6 +3433,7 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
34333433
hsw_disable_ips(crtc);
34343434

34353435
spin_lock_irq(&pipe_crc->lock);
3436+
kfree(pipe_crc->entries);
34363437
pipe_crc->entries = entries;
34373438
pipe_crc->head = 0;
34383439
pipe_crc->tail = 0;

0 commit comments

Comments
 (0)