From patchwork Tue Sep 21 22:02:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sam Tygier X-Patchwork-Id: 198302 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8M0G0QU025559 for ; Wed, 22 Sep 2010 00:16:35 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1C559ECDC for ; Tue, 21 Sep 2010 17:15:59 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.17.9]) by gabe.freedesktop.org (Postfix) with ESMTP id 71DBA9E7F3 for ; Tue, 21 Sep 2010 15:02:31 -0700 (PDT) Received: from [192.168.1.149] (87-127-117-246.static.enta.net [87.127.117.246]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0Li1j8-1OU2su0OcU-00nKvW; Wed, 22 Sep 2010 00:02:30 +0200 Message-ID: <4C992B73.5040605@yahoo.co.uk> Date: Tue, 21 Sep 2010 23:02:27 +0100 From: Sam Tygier User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 MIME-Version: 1.0 To: dri-devel@lists.freedesktop.org Subject: [PATCH] DRM: ignore invalid EDID extensions X-Provags-ID: V02:K0:nFsozoIkEzSUsS87NpiVBkGaoT9uHDupWp5ExZAvgwn sdkEeP8OSvtwUBaQw1Oi5RTeIhMMbUbul8OaS6RJ+/Cj7M5NqJ lZoS91aZcc50dj4NSFhNLnWSS222OOsl4SU+G0GHNON9QUWD/x Mkk3gMSKZ0ROKRM5UtzOGOUBDMIADYfObJij0bV8WWih3m+/F8 Vbo+UV9CYeg0vbv+Vzikw== X-Mailman-Approved-At: Tue, 21 Sep 2010 17:15:17 -0700 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 22 Sep 2010 00:16:35 +0000 (UTC) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index f87bf10..5ade343 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -285,6 +285,15 @@ carp: dev_warn(connector->dev->dev, "%s: EDID block %d invalid.\n", drm_get_connector_name(connector), j); + /* Invalid extension, so set block[0x7e] to zero, and return + * the base block */ + block[EDID_LENGTH-1] += block[0x7e]; + block[0x7e] = 0; + new = krealloc(block, EDID_LENGTH, GFP_KERNEL); + if (!new) + goto out; + block = new; + return block; out: kfree(block); return NULL;