aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-10-29 15:13:40 -0500
committerStefan Richter <stefanr@s5r6.in-berlin.de>2006-12-07 15:43:02 -0500
commitbfe89d724527c8b1bb1b68b0da1d94907b094094 (patch)
tree515e4bcf9e4f6c5cccdeb4ce724e891a1bfa28f2
parent5f8d17f6023ea9aca7c0063c5b472529f2664944 (diff)
drivers/ieee1394/*: use kmemdup()
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r--drivers/ieee1394/nodemgr.c3
-rw-r--r--drivers/ieee1394/pcilynx.c3
2 files changed, 2 insertions, 4 deletions
diff --git a/drivers/ieee1394/nodemgr.c b/drivers/ieee1394/nodemgr.c
index 640d677ae03e..801f60619236 100644
--- a/drivers/ieee1394/nodemgr.c
+++ b/drivers/ieee1394/nodemgr.c
@@ -1078,10 +1078,9 @@ static struct unit_directory *nodemgr_process_unit_directory
1078 /* Logical Unit Number */ 1078 /* Logical Unit Number */
1079 if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) { 1079 if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) {
1080 if (ud->flags & UNIT_DIRECTORY_HAS_LUN) { 1080 if (ud->flags & UNIT_DIRECTORY_HAS_LUN) {
1081 ud_child = kmalloc(sizeof(*ud_child), GFP_KERNEL); 1081 ud_child = kmemdup(ud, sizeof(*ud_child), GFP_KERNEL);
1082 if (!ud_child) 1082 if (!ud_child)
1083 goto unit_directory_error; 1083 goto unit_directory_error;
1084 memcpy(ud_child, ud, sizeof(*ud_child));
1085 nodemgr_register_device(ne, ud_child, &ne->device); 1084 nodemgr_register_device(ne, ud_child, &ne->device);
1086 ud_child = NULL; 1085 ud_child = NULL;
1087 1086
diff --git a/drivers/ieee1394/pcilynx.c b/drivers/ieee1394/pcilynx.c
index 9cab1d661472..13a617917bf2 100644
--- a/drivers/ieee1394/pcilynx.c
+++ b/drivers/ieee1394/pcilynx.c
@@ -1428,10 +1428,9 @@ static int __devinit add_card(struct pci_dev *dev,
1428 struct i2c_algo_bit_data i2c_adapter_data; 1428 struct i2c_algo_bit_data i2c_adapter_data;
1429 1429
1430 error = -ENOMEM; 1430 error = -ENOMEM;
1431 i2c_ad = kmalloc(sizeof(*i2c_ad), GFP_KERNEL); 1431 i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL);
1432 if (!i2c_ad) FAIL("failed to allocate I2C adapter memory"); 1432 if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
1433 1433
1434 memcpy(i2c_ad, &bit_ops, sizeof(struct i2c_adapter));
1435 i2c_adapter_data = bit_data; 1434 i2c_adapter_data = bit_data;
1436 i2c_ad->algo_data = &i2c_adapter_data; 1435 i2c_ad->algo_data = &i2c_adapter_data;
1437 i2c_adapter_data.data = lynx; 1436 i2c_adapter_data.data = lynx;