Skip to content

Commit

Permalink
drm/i915: Reject opening of pipe crc files for invalid pipes
Browse files Browse the repository at this point in the history
We don't init the lock nor set up all the other state. And it doesn't
make sense anyway.

This appeases lockdep when running the igt/drv_debugfs_reader test.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Daniel Vetter committed Nov 14, 2013
1 parent b378360 commit 7eb1c49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/gpu/drm/i915/i915_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,9 @@ static int i915_pipe_crc_open(struct inode *inode, struct file *filep)
struct drm_i915_private *dev_priv = info->dev->dev_private;
struct intel_pipe_crc *pipe_crc = &dev_priv->pipe_crc[info->pipe];

if (info->pipe >= INTEL_INFO(info->dev)->num_pipes)
return -ENODEV;

spin_lock_irq(&pipe_crc->lock);

if (pipe_crc->opened) {
Expand Down

0 comments on commit 7eb1c49

Please sign in to comment.