From 577311992835374a20e22aadec49c5d6b081f302 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Mon, 20 Oct 2003 17:56:07 -0700 Subject: [PATCH] [PATCH] Fix bugs in analog tv i2c-helper chipset drivers - remove cruft, memset() i2c-client structures in tda9840, tea6420, tea6415c driver, otherwise i2c_register()/kobject() segfaults later on --- drivers/media/video/tda9840.c | 3 +-- drivers/media/video/tea6415c.c | 3 +-- drivers/media/video/tea6420.c | 5 ++--- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index 873f96bf605f6..d1e74ecf2c1de 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -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, diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 6ee48f15602fc..4673dfca6caff 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -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, diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index 206c7ec73af01..eca45035470ba 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -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, -- 2.53.0