Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754179Ab3CKUmA (ORCPT ); Mon, 11 Mar 2013 16:42:00 -0400 Received: from mail-we0-f172.google.com ([74.125.82.172]:48437 "EHLO mail-we0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753438Ab3CKUl6 (ORCPT ); Mon, 11 Mar 2013 16:41:58 -0400 From: Alexandru Gheorghiu To: Daniel Vetter Cc: David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Alexandru Gheorghiu Subject: [PATCH] drivers: gpu: drm: i915: Replaced calls to kmalloc & memcpy with kmemdup Date: Mon, 11 Mar 2013 22:39:42 +0200 Message-Id: <1363034382-22752-1-git-send-email-gheorghiuandru@gmail.com> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 33 Replaced calls to kmalloc followed by memcpy with a single call to kmemdup. Also removed a now redundant if statement. Signed-off-by: Alexandru Gheorghiu --- drivers/gpu/drm/i915/intel_dp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f61cb79..3cf8aed 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2335,11 +2335,8 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) return NULL; size = (intel_connector->edid->extensions + 1) * EDID_LENGTH; - edid = kmalloc(size, GFP_KERNEL); - if (!edid) - return NULL; + edid = kmemdup(intel_connector->edid, size, GFP_KERNEL); - memcpy(edid, intel_connector->edid, size); return edid; } -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/