diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2015-11-02 17:32:54 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-11-02 17:32:54 +0100 |
commit | 615240e75926a656ac1c6b118ee8a7babc35142d (patch) | |
tree | 506fc67e9c1eb403905d30f81f809b542f30a952 /drivers/gpu/drm/i915/intel_bios.c | |
parent | 94666f64985e7b83f2af0b03a7849686d2590103 (diff) | |
parent | 10f9e3bce7f3ab7ab4d09a9b78c7208c9a1455f7 (diff) |
Merge branch 'linux-4.1.y' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into linux-4.1.y-rt
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Conflicts:
arch/x86/include/asm/preempt.h
include/linux/sched.h
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_bios.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index c684085cb56a..fadf9865709e 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -41,7 +41,7 @@ find_section(struct bdb_header *bdb, int section_id) { u8 *base = (u8 *)bdb; int index = 0; - u16 total, current_size; + u32 total, current_size; u8 current_id; /* skip to first section */ @@ -56,6 +56,10 @@ find_section(struct bdb_header *bdb, int section_id) current_size = *((u16 *)(base + index)); index += 2; + /* The MIPI Sequence Block v3+ has a separate size field. */ + if (current_id == BDB_MIPI_SEQUENCE && *(base + index) >= 3) + current_size = *((const u32 *)(base + index + 1)); + if (index + current_size > total) return NULL; @@ -845,6 +849,12 @@ parse_mipi(struct drm_i915_private *dev_priv, struct bdb_header *bdb) return; } + /* Fail gracefully for forward incompatible sequence block. */ + if (sequence->version >= 3) { + DRM_ERROR("Unable to parse MIPI Sequence Block v3+\n"); + return; + } + DRM_DEBUG_DRIVER("Found MIPI sequence block\n"); block_size = get_blocksize(sequence); |