@@ -1332,8 +1332,12 @@ int acpi_video_get_edid(struct acpi_device *device, int type, int device_id,
}
}
- *edid = buffer->buffer.pointer;
- return length;
+ *edid = kmemdup(buffer->buffer.pointer, buffer->buffer.length, GFP_KERNEL);
+ kfree(buffer);
+ if (*edid)
+ return length;
+ else
+ return -ENOMEM;
}
return -ENODEV;
@@ -297,6 +297,6 @@ nouveau_acpi_edid(struct drm_device *dev, struct drm_connector *connector)
if (ret < 0)
return ret;
- nv_connector->edid = kmemdup(edid, EDID_LENGTH, GFP_KERNEL);
+ nv_connector->edid = edid;
return 0;
}