summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/udl/udl_connector.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/udl/udl_connector.c')
-rw-r--r--drivers/gpu/drm/udl/udl_connector.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/udl/udl_connector.c b/drivers/gpu/drm/udl/udl_connector.c
index 512f44add89f..fe5cdbcf2636 100644
--- a/drivers/gpu/drm/udl/udl_connector.c
+++ b/drivers/gpu/drm/udl/udl_connector.c
@@ -24,3 +24,3 @@ static u8 *udl_get_edid(struct udl_device *udl)
u8 *block;
- char rbuf[3];
+ char *rbuf;
int ret, i;
@@ -31,2 +31,6 @@ static u8 *udl_get_edid(struct udl_device *udl)
+ rbuf = kmalloc(2, GFP_KERNEL);
+ if (rbuf == NULL)
+ goto error;
+
for (i = 0; i < EDID_LENGTH; i++) {
@@ -38,3 +42,2 @@ static u8 *udl_get_edid(struct udl_device *udl)
DRM_ERROR("Read EDID byte %d failed err %x\n", i, ret);
- i--;
goto error;
@@ -44,2 +47,3 @@ static u8 *udl_get_edid(struct udl_device *udl)
+ kfree(rbuf);
return block;
@@ -48,2 +52,3 @@ error:
kfree(block);
+ kfree(rbuf);
return NULL;
@@ -59,2 +64,10 @@ static int udl_get_modes(struct drm_connector *connector)
+ /*
+ * We only read the main block, but if the monitor reports extension
+ * blocks then the drm edid code expects them to be present, so patch
+ * the extension count to 0.
+ */
+ edid->checksum += edid->extensions;
+ edid->extensions = 0;
+
drm_mode_connector_update_edid_property(connector, edid);