diff options
author | Jerome Glisse <glisse@freedesktop.org> | 2007-11-09 17:28:56 +0100 |
---|---|---|
committer | Jerome Glisse <glisse@freedesktop.org> | 2007-11-09 17:28:56 +0100 |
commit | e1bc147ac9aa8ac2ac271b0a21f4138b17875ce5 (patch) | |
tree | c99476b218d152363309c80d8e506cddab5a5cbc /linux-core | |
parent | ffb89d4c3b6650551aaab06076896540a78faddf (diff) |
drm: check edid data, so we deal well with broken driver.
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/drm_edid.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/linux-core/drm_edid.c b/linux-core/drm_edid.c index b8eee1a4..7068cef3 100644 --- a/linux-core/drm_edid.c +++ b/linux-core/drm_edid.c @@ -469,6 +469,14 @@ int drm_add_edid_modes(struct drm_output *output, struct edid *edid) { int num_modes = 0; + if (edid == NULL) { + return 0; + } + if (!edid_valid(edid)) { + dev_warn(&output->dev->pdev->dev, "%s: EDID invalid.\n", + output->name); + return 0; + } num_modes += add_established_modes(output, edid); num_modes += add_standard_modes(output, edid); num_modes += add_detailed_info(output, edid); |