diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-12-10 13:00:29 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-12-10 19:47:27 +0300 |
commit | 64387b613a43713d0e03d9d43bfbb1727e8475e1 (patch) | |
tree | 06d3bdfd27694d2d7f588d32a6b9a0876820a989 /drivers | |
parent | 9ad6d99f189c274b42bedd6efc2b31a17ce733a7 (diff) | |
download | linux-64387b613a43713d0e03d9d43bfbb1727e8475e1.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_debugfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 252b0b2b514c..165a38f36009 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -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; |