[PATCH v2 04/18] DRM/KMS/EDID: Don't fail when failing to allocate memory for EDID extensions.
Egbert Eich
eich at suse.com
Thu Nov 22 02:22:54 PST 2012
When we fail to allocate space for EDID extensions we should just
warn, fix up the EDID block count and return the base block instead
of failing.
Signed-off-by: Egbert Eich <eich at suse.com>
---
drivers/gpu/drm/drm_edid.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 043ba42..a952cfe 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -347,8 +347,11 @@ drm_do_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
return block;
new = krealloc(block, (block[EDID_EXTENSION_FLAG_OFFSET] + 1) * EDID_LENGTH, GFP_KERNEL);
- if (!new)
- goto out;
+ if (!new) {
+ dev_warn(connector->dev->dev, "%s: cannot allocate memory for %d EDID blocks: truncating.\n",
+ drm_get_connector_name(connector), block[EDID_EXTENSION_FLAG_OFFSET] + 1);
+ goto done_fix_extension_count;
+ }
block = new;
for (j = 1; j <= block[EDID_EXTENSION_FLAG_OFFSET]; j++) {
--
1.7.7
More information about the dri-devel
mailing list