summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_bios.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2015-08-24 16:36:42 +1000
committerDave Airlie <airlied@redhat.com>2015-08-24 16:36:42 +1000
commit3732ce72b45a2a145803558758821bf198751276 (patch)
tree75047ed1f43cfd56231535c401924dbb27c4d0f0 /drivers/gpu/drm/i915/intel_bios.c
parente829d7ef9f17d7b84d4c3d110ecd4b7b2bcba865 (diff)
parentc13dcf9f2d6f5f06ef1bf79ec456df614c5e058b (diff)
downloadblackbird-op-linux-3732ce72b45a2a145803558758821bf198751276.tar.gz
blackbird-op-linux-3732ce72b45a2a145803558758821bf198751276.zip
Merge tag 'v4.2-rc8' into drm-next
Linux 4.2-rc8 Backmerge required for Intel so they can fix their -next tree up properly.
Diffstat (limited to 'drivers/gpu/drm/i915/intel_bios.c')
-rw-r--r--drivers/gpu/drm/i915/intel_bios.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index 8e46149bafdd..c5b82fed95be 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -1051,34 +1051,15 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
const union child_device_config *p_child;
union child_device_config *child_dev_ptr;
int i, child_device_num, count;
- u8 expected_size;
- u16 block_size;
+ u16 block_size;
p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
if (!p_defs) {
DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
return;
}
- if (bdb->version < 195) {
- expected_size = 33;
- } else if (bdb->version == 195) {
- expected_size = 37;
- } else if (bdb->version <= 197) {
- expected_size = 38;
- } else {
- expected_size = 38;
- DRM_DEBUG_DRIVER("Expected child_device_config size for BDB version %u not known; assuming %u\n",
- expected_size, bdb->version);
- }
-
- if (expected_size > sizeof(*p_child)) {
- DRM_ERROR("child_device_config cannot fit in p_child\n");
- return;
- }
-
- if (p_defs->child_dev_size != expected_size) {
- DRM_ERROR("Size mismatch; child_device_config size=%u (expected %u); bdb->version: %u\n",
- p_defs->child_dev_size, expected_size, bdb->version);
+ if (p_defs->child_dev_size < sizeof(*p_child)) {
+ DRM_ERROR("General definiton block child device size is too small.\n");
return;
}
/* get the block size of general definitions */
@@ -1125,7 +1106,7 @@ parse_device_mapping(struct drm_i915_private *dev_priv,
child_dev_ptr = dev_priv->vbt.child_dev + count;
count++;
- memcpy(child_dev_ptr, p_child, p_defs->child_dev_size);
+ memcpy(child_dev_ptr, p_child, sizeof(*p_child));
}
return;
}
OpenPOWER on IntegriCloud