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

Commit 64387b61 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parent 9ad6d99f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3433,6 +3433,7 @@ static int pipe_crc_set_source(struct drm_device *dev, enum pipe pipe,
		hsw_disable_ips(crtc);

		spin_lock_irq(&pipe_crc->lock);
		kfree(pipe_crc->entries);
		pipe_crc->entries = entries;
		pipe_crc->head = 0;
		pipe_crc->tail = 0;