lkml.org 
[lkml]   [2013]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] drivers: gpu: drm: i915: Replaced calls to kmalloc & memcpy with kmemdup
Date
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 <gheorghiuandru@gmail.com>
---
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


\
 
 \ /
  Last update: 2013-03-11 22:24    [W:0.104 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site