From bfba7b3793f59adedfde5fb07dee565c5cc15ab8 Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Fri, 8 Dec 2006 02:40:46 -0800 Subject: [PATCH] drivers/video/*: use kmemdup() From: Eric Sesterhenn Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/nvidia/nv_i2c.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers/video/nvidia/nv_i2c.c') diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index 19eef3a0902..442e8532834 100644 --- a/drivers/video/nvidia/nv_i2c.c +++ b/drivers/video/nvidia/nv_i2c.c @@ -210,11 +210,8 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) /* try to get from firmware */ const u8 *e = fb_firmware_edid(info->device); - if (e != NULL) { - edid = kmalloc(EDID_LENGTH, GFP_KERNEL); - if (edid) - memcpy(edid, e, EDID_LENGTH); - } + if (e != NULL) + edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL); } *out_edid = edid; -- cgit v1.2.3-18-g5258