@@ -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++) {
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@suse.com> --- drivers/gpu/drm/drm_edid.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-)