[PATCH v2 07/18] DRM/KMS/EDID: Don't reallocate EDID blob when size has shrunk.
Egbert Eich
eich at suse.com
Thu Nov 22 02:22:57 PST 2012
valid_extensions (the number of EDID extensions found to be valid)
can never be > block[EDID_EXTENSION_FLAG_OFFSET].
There is no point of reallocating the block in this case: the
extra blocks at the end of the EDID structure will not hurt,
also the implementation of krealloc() will just return the same
block.
Signed-off-by: Egbert Eich <eich at suse.com>
---
drivers/gpu/drm/drm_edid.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index da2f7fa..0fe61fb 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -396,10 +396,6 @@ done_fix_extension_count:
if (valid_extensions != block[EDID_EXTENSION_FLAG_OFFSET]) {
block[EDID_CHECKSUM_OFFSET] += block[EDID_EXTENSION_FLAG_OFFSET] - valid_extensions;
block[EDID_EXTENSION_FLAG_OFFSET] = valid_extensions;
- new = krealloc(block, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL);
- if (!new)
- goto out;
- block = new;
}
return block;
--
1.7.7
More information about the dri-devel
mailing list