mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Hunold <hunold@linuxtv.org>
To: torvalds@osdl.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] Fix bugs in analog tv i2c-helper chipset drivers
Date: Tue, 21 Oct 2003 11:36:54 +0200	[thread overview]
Message-ID: <10667290143917@convergence.de> (raw)
In-Reply-To: <1066729014790@convergence.de>

- [V4L] remove cruft, memset() i2c-client structures in tda9840, tea6420, tea6415c driver, otherwise i2c_register()/kobject() segfaults later on
diff -ura xx-linux-2.6.0-test8/drivers/media/video/tda9840.c linux-2.6.0-test8-p/drivers/media/video/tda9840.c
--- xx-linux-2.6.0-test8/drivers/media/video/tda9840.c	2003-09-10 11:28:54.000000000 +0200
+++ linux-2.6.0-test8-p/drivers/media/video/tda9840.c	2003-10-21 11:21:02.000000000 +0200
@@ -196,6 +196,7 @@
 		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 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 -ura xx-linux-2.6.0-test8/drivers/media/video/tea6415c.c linux-2.6.0-test8-p/drivers/media/video/tea6415c.c
--- xx-linux-2.6.0-test8/drivers/media/video/tea6415c.c	2003-09-10 11:28:54.000000000 +0200
+++ linux-2.6.0-test8-p/drivers/media/video/tea6415c.c	2003-10-21 11:20:48.000000000 +0200
@@ -70,6 +70,7 @@
         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 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 -ura xx-linux-2.6.0-test8/drivers/media/video/tea6420.c linux-2.6.0-test8-p/drivers/media/video/tea6420.c
--- xx-linux-2.6.0-test8/drivers/media/video/tea6420.c	2003-09-10 11:28:54.000000000 +0200
+++ linux-2.6.0-test8-p/drivers/media/video/tea6420.c	2003-10-21 11:20:56.000000000 +0200
@@ -110,7 +110,8 @@
         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 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,


      reply	other threads:[~2003-10-21  9:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21  9:36 [PATCH 0/3] LinuxTV.org DVB+V4L fixes Michael Hunold
2003-10-21  9:36 ` [PATCH 1/3] Fix bugs in various DVB drivers Michael Hunold
2003-10-21  9:36   ` [PATCH 2/3] Fix bug in saa7146 analog tv i2c-handling Michael Hunold
2003-10-21  9:36     ` Michael Hunold [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10667290143917@convergence.de \
    --to=hunold@linuxtv.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome