]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Fix bugs in analog tv i2c-helper chipset drivers
authorMichael Hunold <hunold@linuxtv.org>
Tue, 21 Oct 2003 00:56:07 +0000 (17:56 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Tue, 21 Oct 2003 00:56:07 +0000 (17:56 -0700)
 - remove cruft, memset() i2c-client structures in tda9840, tea6420,
    tea6415c driver, otherwise i2c_register()/kobject() segfaults later on

drivers/media/video/tda9840.c
drivers/media/video/tea6415c.c
drivers/media/video/tea6420.c

index 873f96bf605f63937d6fad363d1ff93a94ad324c..d1e74ecf2c1de4767d672757eaa2a5d52f409e44 100644 (file)
@@ -196,6 +196,7 @@ static int tda9840_detect(struct i2c_adapter *adapter, int address, int kind)
                printk("tda9840.o: not enough kernel memory.\n");
                return -ENOMEM;
        }
+       memset(client, 0, sizeof(struct i2c_client));
        
        /* fill client structure */
        sprintf(client->name,"tda9840 (0x%02x)", address);
@@ -258,9 +259,7 @@ static int tda9840_detach(struct i2c_client *client)
 }
 
 static struct i2c_driver driver = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
        .owner          = THIS_MODULE,
-#endif
        .name           = "tda9840 driver",
        .id             = I2C_DRIVERID_TDA9840,
        .flags          = I2C_DF_NOTIFY,
index 6ee48f15602fc2f03fd10e4a64311ac129e2a892..4673dfca6caff6f89e1233158285fc156953ed48 100644 (file)
@@ -70,6 +70,7 @@ static int tea6415c_detect(struct i2c_adapter *adapter, int address, int kind)
         if (0 == client) {
                return -ENOMEM;
        }
+       memset(client, 0, sizeof(struct i2c_client));
 
        /* fill client structure */
        sprintf(client->name,"tea6415c (0x%02x)", address);
@@ -207,9 +208,7 @@ static int tea6415c_command(struct i2c_client *client, unsigned int cmd, void* a
 }
 
 static struct i2c_driver driver = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
        .owner          = THIS_MODULE,
-#endif
        .name           = "tea6415c driver",
        .id             = I2C_DRIVERID_TEA6415C,
        .flags          = I2C_DF_NOTIFY,
index 206c7ec73af01dde8966d8c9c04731bafe7d0897..eca45035470ba51d56a9d894f159707a16557218 100644 (file)
@@ -110,7 +110,8 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind)
         if (0 == client) {
                return -ENOMEM;
        }
-       
+       memset(client, 0x0, sizeof(struct i2c_client)); 
+
        /* fill client structure */
        sprintf(client->name,"tea6420 (0x%02x)", address);
        client->id = tea6420_id++;
@@ -187,9 +188,7 @@ static int tea6420_command(struct i2c_client *client, unsigned int cmd, void* ar
 }
 
 static struct i2c_driver driver = {
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,54)
        .owner          = THIS_MODULE,
-#endif
        .name           = "tea6420 driver",
        .id             = I2C_DRIVERID_TEA6420,
        .flags          = I2C_DF_NOTIFY,