summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_audio.c
diff options
context:
space:
mode:
authorMika Kahola2017-12-18 09:04:03 +0100
committerJani Nikula2018-01-19 15:15:50 +0100
commit0b7029b7e43fda1304c181a3ade0b429b9edcd9d (patch)
treefe17fd08556c7962ad9f78272ba5b561842fbed9 /drivers/gpu/drm/i915/intel_audio.c
parentdrm/i915: Allow up to 32KB stride on SKL+ "sprites" (diff)
downloadkernel-qcow2-linux-0b7029b7e43fda1304c181a3ade0b429b9edcd9d.tar.gz
kernel-qcow2-linux-0b7029b7e43fda1304c181a3ade0b429b9edcd9d.tar.xz
kernel-qcow2-linux-0b7029b7e43fda1304c181a3ade0b429b9edcd9d.zip
drm/i915: Check for fused or unused pipes
We may have fused or unused pipes in our system. Let's check that the pipe in question is within limits of accessible pipes. In case, that we are not able to access the pipe, we return early with a warning. v2: Rephrasing of the commit message (Jani) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103206 Reported-by: Thomas Gleixner <tglx@linutronix.de> Tested-by: Jaswinder Singh Rajput <jaswinder@perfectintelligent.com> Suggested-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/1513584243-12607-1-git-send-email-mika.kahola@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_audio.c')
-rw-r--r--drivers/gpu/drm/i915/intel_audio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
index f1502a0188eb..522d54fecb53 100644
--- a/drivers/gpu/drm/i915/intel_audio.c
+++ b/drivers/gpu/drm/i915/intel_audio.c
@@ -779,7 +779,7 @@ static struct intel_encoder *get_saved_enc(struct drm_i915_private *dev_priv,
{
struct intel_encoder *encoder;
- if (WARN_ON(pipe >= INTEL_INFO(dev_priv)->num_pipes))
+ if (WARN_ON(pipe >= ARRAY_SIZE(dev_priv->av_enc_map)))
return NULL;
/* MST */