diff options
Diffstat (limited to 'drivers/ieee1394/pcilynx.c')
-rw-r--r-- | drivers/ieee1394/pcilynx.c | 3 |
1 files changed, 1 insertions, 2 deletions
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; |