]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ieee1394/pcilynx.c
old buffer overflow in moxa driver
[linux-2.6-omap-h63xx.git] / drivers / ieee1394 / pcilynx.c
index b4f146f2c951c9f7f2f208d8ec972d29e95f77eb..0742befe92270f0d9557072dc59a6b2771e5197c 100644 (file)
@@ -839,8 +839,7 @@ static int lynx_devctl(struct hpsb_host *host, enum devctl_cmd cmd, int arg)
  ********************************************************/
 
 
-static irqreturn_t lynx_irq_handler(int irq, void *dev_id,
-                             struct pt_regs *regs_are_unused)
+static irqreturn_t lynx_irq_handler(int irq, void *dev_id)
 {
         struct ti_lynx *lynx = (struct ti_lynx *)dev_id;
         struct hpsb_host *host = lynx->host;
@@ -1429,13 +1428,13 @@ static int __devinit add_card(struct pci_dev *dev,
                struct i2c_algo_bit_data i2c_adapter_data;
 
                error = -ENOMEM;
-               i2c_ad = kmalloc(sizeof(*i2c_ad), SLAB_KERNEL);
+               i2c_ad = kmemdup(&bit_ops, sizeof(*i2c_ad), GFP_KERNEL);
                if (!i2c_ad) FAIL("failed to allocate I2C adapter memory");
 
-               memcpy(i2c_ad, &bit_ops, sizeof(struct i2c_adapter));
                 i2c_adapter_data = bit_data;
                 i2c_ad->algo_data = &i2c_adapter_data;
                 i2c_adapter_data.data = lynx;
+               i2c_ad->dev.parent = &dev->dev;
 
                PRINTD(KERN_DEBUG, lynx->id,"original eeprom control: %d",
                       reg_read(lynx, SERIAL_EEPROM_CONTROL));
@@ -1487,7 +1486,7 @@ static int __devinit add_card(struct pci_dev *dev,
 
                         }
 
-                        i2c_bit_del_bus(i2c_ad);
+                       i2c_del_adapter(i2c_ad);
                        kfree(i2c_ad);
                 }
         }