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 | |
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>
-rw-r--r-- | drivers/video/aty/radeon_monitor.c | 3 | ||||
-rw-r--r-- | drivers/video/i810/i810-i2c.c | 4 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 3 | ||||
-rw-r--r-- | drivers/video/nvidia/nv_i2c.c | 7 | ||||
-rw-r--r-- | drivers/video/nvidia/nv_of.c | 3 | ||||
-rw-r--r-- | drivers/video/savage/savagefb-i2c.c | 7 |
6 files changed, 8 insertions, 19 deletions
diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index ea531a6f45d..38c7dbf8c15 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c | |||
@@ -104,10 +104,9 @@ static int __devinit radeon_parse_montype_prop(struct device_node *dp, u8 **out_ | |||
104 | if (pedid == NULL) | 104 | if (pedid == NULL) |
105 | return mt; | 105 | return mt; |
106 | 106 | ||
107 | tmp = (u8 *)kmalloc(EDID_LENGTH, GFP_KERNEL); | 107 | tmp = kmemdup(pedid, EDID_LENGTH, GFP_KERNEL); |
108 | if (!tmp) | 108 | if (!tmp) |
109 | return mt; | 109 | return mt; |
110 | memcpy(tmp, pedid, EDID_LENGTH); | ||
111 | *out_EDID = tmp; | 110 | *out_EDID = tmp; |
112 | return mt; | 111 | return mt; |
113 | } | 112 | } |
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c index b38d805db31..b952e4504ab 100644 --- a/drivers/video/i810/i810-i2c.c +++ b/drivers/video/i810/i810-i2c.c | |||
@@ -162,9 +162,7 @@ int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn) | |||
162 | 162 | ||
163 | if (e != NULL) { | 163 | if (e != NULL) { |
164 | DPRINTK("i810-i2c: Getting EDID from BIOS\n"); | 164 | DPRINTK("i810-i2c: Getting EDID from BIOS\n"); |
165 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 165 | edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL); |
166 | if (edid) | ||
167 | memcpy(edid, e, EDID_LENGTH); | ||
168 | } | 166 | } |
169 | } | 167 | } |
170 | 168 | ||
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 6f9de04193d..664fc5cf962 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -1058,10 +1058,9 @@ intelfb_init_var(struct intelfb_info *dinfo) | |||
1058 | u8 *edid_d = NULL; | 1058 | u8 *edid_d = NULL; |
1059 | 1059 | ||
1060 | if (edid_s) { | 1060 | if (edid_s) { |
1061 | edid_d = kmalloc(EDID_LENGTH, GFP_KERNEL); | 1061 | edid_d = kmemdup(edid_s, EDID_LENGTH, GFP_KERNEL); |
1062 | 1062 | ||
1063 | if (edid_d) { | 1063 | if (edid_d) { |
1064 | memcpy(edid_d, edid_s, EDID_LENGTH); | ||
1065 | fb_edid_to_monspecs(edid_d, | 1064 | fb_edid_to_monspecs(edid_d, |
1066 | &dinfo->info->monspecs); | 1065 | &dinfo->info->monspecs); |
1067 | kfree(edid_d); | 1066 | kfree(edid_d); |
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) | |||
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 d9af88c2b58..181875fe35c 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 | } |
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 3f94223b7f0..cef5bf591cd 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c | |||
@@ -227,11 +227,8 @@ int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid) | |||
227 | /* try to get from firmware */ | 227 | /* try to get from firmware */ |
228 | const u8 *e = fb_firmware_edid(info->device); | 228 | const u8 *e = fb_firmware_edid(info->device); |
229 | 229 | ||
230 | if (e) { | 230 | if (e) |
231 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 231 | edid = kmemdup(e, EDID_LENGTH, GFP_KERNEL); |
232 | if (edid) | ||
233 | memcpy(edid, e, EDID_LENGTH); | ||
234 | } | ||
235 | } | 232 | } |
236 | 233 | ||
237 | *out_edid = edid; | 234 | *out_edid = edid; |