From patchwork Thu Nov 22 10:22:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 1783291 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 6ECD03FC64 for ; Thu, 22 Nov 2012 10:56:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 63528E64B2 for ; Thu, 22 Nov 2012 02:56:23 -0800 (PST) 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 94673E5EA0 for ; Thu, 22 Nov 2012 02:51:06 -0800 (PST) Received: from debian (p5DCF0728.dip0.t-ipconnect.de [93.207.7.40]) by mrelayeu.kundenserver.de (node=mrbap4) with ESMTP (Nemesis) id 0M0RFl-1TH5Cn2RQb-00uZ8y; Thu, 22 Nov 2012 11:51:05 +0100 Received: from sles11.fritz.box (sles11.fritz.box [192.168.178.22]) by debian (Postfix) with ESMTP id 7E9E43F361; Thu, 22 Nov 2012 11:51:01 +0100 (CET) From: Egbert Eich To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 07/18] DRM/KMS/EDID: Don't reallocate EDID blob when size has shrunk. Date: Thu, 22 Nov 2012 05:22:57 -0500 Message-Id: <1353579788-30637-8-git-send-email-eich@suse.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1353579788-30637-1-git-send-email-eich@suse.com> References: <1353356598-10634-1-git-send-email-eich@suse.de> <1353579788-30637-1-git-send-email-eich@suse.com> X-Provags-ID: V02:K0:qhAHIlvRIifGo7eUyuV+cO6aBmI5PsB1rAnhKdKafXp Jeg5UNnHoNE91uGvb/fmtviX/AExe6gnHYxu7Y02sZ9sR5FkWV R5kP83TS8Mk6FpK+Diprnci8hAQTDpy/HLxTJgi+LEBE9uywsO z5yn4WzKVG1zhgRZDnQV67ZXDVEAWzh81lZJToo5sCTQQ6ByUn EYFNIOfD/lxdcMFfU3inGP1c6osN5GsxyLd2fec/jTnutfNf+m zpzJJXtlK9MVDhw6Uhonk9lhvmNuz4lmRr7m/ofEdaBt05KLLU JdD0GFv0cSYO2UIw0dI5sxeyxbK5bdnuKFBPSIFy13EG4WlmTd XgU315QTKu/KGW/cROxQ= Cc: Egbert Eich , tiwai@suse.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 valid_extensions (the number of EDID extensions found to be valid) can never be > block[EDID_EXTENSION_FLAG_OFFSET]. There is no point of reallocating the block in this case: the extra blocks at the end of the EDID structure will not hurt, also the implementation of krealloc() will just return the same block. Signed-off-by: Egbert Eich --- drivers/gpu/drm/drm_edid.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index da2f7fa..0fe61fb 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -396,10 +396,6 @@ done_fix_extension_count: if (valid_extensions != block[EDID_EXTENSION_FLAG_OFFSET]) { block[EDID_CHECKSUM_OFFSET] += block[EDID_EXTENSION_FLAG_OFFSET] - valid_extensions; block[EDID_EXTENSION_FLAG_OFFSET] = valid_extensions; - new = krealloc(block, (valid_extensions + 1) * EDID_LENGTH, GFP_KERNEL); - if (!new) - goto out; - block = new; } return block;