diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2006-12-08 05:40:46 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-08 11:29:07 -0500 |
commit | bfba7b3793f59adedfde5fb07dee565c5cc15ab8 (patch) | |
tree | d9e0559f288f0bc24df71ad46800e8cb2b779c59 /drivers/video/nvidia | |
parent | efc08a75d3a2d449edab7d1bee312eaa591f7669 (diff) |
[PATCH] drivers/video/*: use kmemdup()
From: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video/nvidia')
-rw-r--r-- | drivers/video/nvidia/nv_i2c.c | 7 | ||||
-rw-r--r-- | drivers/video/nvidia/nv_of.c | 3 |
2 files changed, 3 insertions, 7 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index 19eef3a09023..442e85328341 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) | |||
210 | /* try to get from firmware */ | 210 | /* try to get from firmware */ |
211 | const u8 *e = fb_firmware_edid(info->device); | 211 | const u8 *e = fb_firmware_edid(info->device); |
212 | 212 | ||
213 | if (e != NULL) { | 213 | if (e != NULL) |
214 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 214 | edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL); |
215 | if (edid) | ||
216 | memcpy(edid, e, EDID_LENGTH); | ||
217 | } | ||
218 | } | 215 | } |
219 | 216 | ||
220 | *out_edid = edid; | 217 | *out_edid = edid; |
diff --git a/drivers/video/nvidia/nv_of.c b/drivers/video/nvidia/nv_of.c index d9af88c2b580..181875fe35c6 100644 --- a/drivers/video/nvidia/nv_of.c +++ b/drivers/video/nvidia/nv_of.c | |||
@@ -72,10 +72,9 @@ int nvidia_probe_of_connector(struct fb_info *info, int conn, u8 **out_edid) | |||
72 | } | 72 | } |
73 | } | 73 | } |
74 | if (pedid) { | 74 | if (pedid) { |
75 | *out_edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 75 | *out_edid = kmemdup(pedid, EDID_LENGTH, GFP_KERNEL); |
76 | if (*out_edid == NULL) | 76 | if (*out_edid == NULL) |
77 | return -1; | 77 | return -1; |
78 | memcpy(*out_edid, pedid, EDID_LENGTH); | ||
79 | printk(KERN_DEBUG "nvidiafb: Found OF EDID for head %d\n", conn); | 78 | printk(KERN_DEBUG "nvidiafb: Found OF EDID for head %d\n", conn); |
80 | return 0; | 79 | return 0; |
81 | } | 80 | } |