From patchwork Mon Jul 1 10:06:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Seung-Woo Kim X-Patchwork-Id: 2806881 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E6B59BF4A1 for ; Mon, 1 Jul 2013 10:08:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1C4F2019C for ; Mon, 1 Jul 2013 10:08:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A160820186 for ; Mon, 1 Jul 2013 10:08:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C8E5E6054 for ; Mon, 1 Jul 2013 03:08:30 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 31EEAE5EB0 for ; Mon, 1 Jul 2013 03:06:33 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MP900CKW5EJUH90@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 01 Jul 2013 19:06:21 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 3C.6B.08825.D9451D15; Mon, 01 Jul 2013 19:06:21 +0900 (KST) X-AuditID: cbfee68e-b7f276d000002279-10-51d1549d418e Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id CE.BD.21068.D9451D15; Mon, 01 Jul 2013 19:06:21 +0900 (KST) Received: from localhost.localdomain ([10.90.8.56]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MP90081J5EI5WD0@mmp1.samsung.com>; Mon, 01 Jul 2013 19:06:21 +0900 (KST) From: Seung-Woo Kim To: dri-devel@lists.freedesktop.org, airlied@linux.ie Subject: [PATCH 2/3] drm: move edid null check to the first part of drm_edid_block_valid Date: Mon, 01 Jul 2013 19:06:32 +0900 Message-id: <1372673193-18824-3-git-send-email-sw0312.kim@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1372673193-18824-1-git-send-email-sw0312.kim@samsung.com> References: <1372673193-18824-1-git-send-email-sw0312.kim@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMLMWRmVeSWpSXmKPExsWyRsSkRHduyMVAg3tztSx6z51ksrjy9T2b xdmmN+wWMya/ZLPYu3MyowOrx/ZvD1g97ncfZ/Lo27KKMYA5issmJTUnsyy1SN8ugSvj2aTF rAWLOComP9NsYLzO1sXIySEhYCLRP+EklC0mceHeeiCbi0NIYCmjxKLDPXBFH94cZ4RILGKU WN0wjR3CaWaS6H3ZzgpSxSagI7F/yW8wW0TAVOLs5WvMIDazgLfEju33wOLCAlESzRvngcVZ BFQl2nZvYwSxeQXcJO7eP8IIsU1BYsG9t2CbOQXcJS4f/wsWFwKqmfLrOAvIYgmB32wS3/7f YoIYJCDxbfIhoAQHUEJWYtMBZog5khIHV9xgmcAovICRYRWjaGpBckFxUnqRkV5xYm5xaV66 XnJ+7iZGYACf/vesbwfjzQPWhxiTgcZNZJYSTc4HRkBeSbyhsZmRhamJqbGRuaUZacJK4rxq LdaBQgLpiSWp2ampBalF8UWlOanFhxiZODilGhgN8hJSM9qfXNwaeV6uOPP6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Loop: Reflected Cc: kyungmin.park@samsung.com, sw0312.kim@samsung.com, yj44.cho@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If raw_edid is null, it will crash, so checking in bad label is meaningless. Signed-off-by: Seung-Woo Kim Signed-off-by: Kyungmin Park Reviewed-by: Chris Wilson --- drivers/gpu/drm/drm_edid.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 2dc1a60..dbaed34 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -968,6 +968,9 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid) u8 csum = 0; struct edid *edid = (struct edid *)raw_edid; + if (!raw_edid) + return 0; + if (edid_fixup > 8 || edid_fixup < 0) edid_fixup = 6; @@ -1013,7 +1016,7 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid) return 1; bad: - if (raw_edid && print_bad_edid) { + if (print_bad_edid) { printk(KERN_ERR "Raw EDID:\n"); print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1, raw_edid, EDID_LENGTH, false);