]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
added new 2.6.16 driver core patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Mar 2006 18:24:17 +0000 (10:24 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 23 Mar 2006 18:24:17 +0000 (10:24 -0800)
queue-2.6.16/driver-0001-sysfs-sysfs_remove_dir-needs-to-invalidate-the-dentry.patch [new file with mode: 0644]
queue-2.6.16/driver-0014-firmware-fix-BUG-in-fw_realloc_buffer.patch [new file with mode: 0644]
queue-2.6.16/driver-0021-get_cpu_sysdev-signedness-fix.patch [new file with mode: 0644]
queue-2.6.16/driver-0023-sysfs-fix-a-kobject-leak-in-sysfs_add_link-on-the-error-path.patch [new file with mode: 0644]

diff --git a/queue-2.6.16/driver-0001-sysfs-sysfs_remove_dir-needs-to-invalidate-the-dentry.patch b/queue-2.6.16/driver-0001-sysfs-sysfs_remove_dir-needs-to-invalidate-the-dentry.patch
new file mode 100644 (file)
index 0000000..7921de4
--- /dev/null
@@ -0,0 +1,54 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu Mar 16 15:44:26 2006 -0800
+Subject: [PATCH 01/23] sysfs: sysfs_remove_dir() needs to invalidate the dentry
+
+When calling sysfs_remove_dir() don't allow any further sysfs functions
+to work for this kobject anymore.  This fixes a nasty USB cdc-acm oops
+on disconnect.
+
+Many thanks to Bob Copeland and Paul Fulghum for taking the time to
+track this down.
+
+Cc: Bob Copeland <email@bobcopeland.com>
+Cc: Paul Fulghum <paulkf@microgate.com>
+Cc: Maneesh Soni <maneesh@in.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+
+ fs/sysfs/dir.c   |    1 +
+ fs/sysfs/inode.c |    6 +++++-
+ 2 files changed, 6 insertions(+), 1 deletion(-)
+
+641e6f30a095f3752ed84fd9d279382f5d3ef4c1
+--- linux-2.6.16.orig/fs/sysfs/dir.c
++++ linux-2.6.16/fs/sysfs/dir.c
+@@ -302,6 +302,7 @@ void sysfs_remove_dir(struct kobject * k
+        * Drop reference from dget() on entrance.
+        */
+       dput(dentry);
++      kobj->dentry = NULL;
+ }
+ int sysfs_rename_dir(struct kobject * kobj, const char *new_name)
+--- linux-2.6.16.orig/fs/sysfs/inode.c
++++ linux-2.6.16/fs/sysfs/inode.c
+@@ -227,12 +227,16 @@ void sysfs_drop_dentry(struct sysfs_dire
+ void sysfs_hash_and_remove(struct dentry * dir, const char * name)
+ {
+       struct sysfs_dirent * sd;
+-      struct sysfs_dirent * parent_sd = dir->d_fsdata;
++      struct sysfs_dirent * parent_sd;
++
++      if (!dir)
++              return;
+       if (dir->d_inode == NULL)
+               /* no inode means this hasn't been made visible yet */
+               return;
++      parent_sd = dir->d_fsdata;
+       mutex_lock(&dir->d_inode->i_mutex);
+       list_for_each_entry(sd, &parent_sd->s_children, s_sibling) {
+               if (!sd->s_element)
diff --git a/queue-2.6.16/driver-0014-firmware-fix-BUG-in-fw_realloc_buffer.patch b/queue-2.6.16/driver-0014-firmware-fix-BUG-in-fw_realloc_buffer.patch
new file mode 100644 (file)
index 0000000..8b640dc
--- /dev/null
@@ -0,0 +1,49 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Jeff Moyer <jmoyer@redhat.com>
+Date: Mon Feb 13 14:52:38 2006 -0800
+Subject: [PATCH 14/23] firmware: fix BUG: in fw_realloc_buffer
+
+The fw_realloc_buffer routine does not handle an increase in buffer size of
+more than 4k.  It's not clear to me why it expects that it will only get an
+extra 4k of data.  The attached patch modifies fw_realloc_buffer to vmalloc
+as much memory as is requested, instead of what we previously had + 4k.
+
+I've tested this on my laptop, which would crash occaisionally on boot
+without the patch.  With the patch, it hasn't crashed, but I can't be
+certain that this code path is exercised.
+
+Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+
+ drivers/base/firmware_class.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+30560ba6eda308c13a361d08eb5d4eaab94ab37e
+--- linux-2.6.16.orig/drivers/base/firmware_class.c
++++ linux-2.6.16/drivers/base/firmware_class.c
+@@ -211,18 +211,20 @@ static int
+ fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size)
+ {
+       u8 *new_data;
++      int new_size = fw_priv->alloc_size;
+       if (min_size <= fw_priv->alloc_size)
+               return 0;
+-      new_data = vmalloc(fw_priv->alloc_size + PAGE_SIZE);
++      new_size = ALIGN(min_size, PAGE_SIZE);
++      new_data = vmalloc(new_size);
+       if (!new_data) {
+               printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__);
+               /* Make sure that we don't keep incomplete data */
+               fw_load_abort(fw_priv);
+               return -ENOMEM;
+       }
+-      fw_priv->alloc_size += PAGE_SIZE;
++      fw_priv->alloc_size = new_size;
+       if (fw_priv->fw->data) {
+               memcpy(new_data, fw_priv->fw->data, fw_priv->fw->size);
+               vfree(fw_priv->fw->data);
diff --git a/queue-2.6.16/driver-0021-get_cpu_sysdev-signedness-fix.patch b/queue-2.6.16/driver-0021-get_cpu_sysdev-signedness-fix.patch
new file mode 100644 (file)
index 0000000..0473dbd
--- /dev/null
@@ -0,0 +1,39 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Andrew Morton <akpm@osdl.org>
+Date: Tue Mar 7 23:53:25 2006 -0800
+Subject: [PATCH 21/23] get_cpu_sysdev() signedness fix
+
+Doing (int < NR_CPUS) doesn't dtrt if it's negative..
+
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+
+ drivers/base/cpu.c  |    2 +-
+ include/linux/cpu.h |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+a29d642a4aa99c5234314ab2523281139226c231
+--- linux-2.6.16.orig/drivers/base/cpu.c
++++ linux-2.6.16/drivers/base/cpu.c
+@@ -141,7 +141,7 @@ int __devinit register_cpu(struct cpu *c
+       return error;
+ }
+-struct sys_device *get_cpu_sysdev(int cpu)
++struct sys_device *get_cpu_sysdev(unsigned cpu)
+ {
+       if (cpu < NR_CPUS)
+               return cpu_sys_devices[cpu];
+--- linux-2.6.16.orig/include/linux/cpu.h
++++ linux-2.6.16/include/linux/cpu.h
+@@ -32,7 +32,7 @@ struct cpu {
+ };
+ extern int register_cpu(struct cpu *, int, struct node *);
+-extern struct sys_device *get_cpu_sysdev(int cpu);
++extern struct sys_device *get_cpu_sysdev(unsigned cpu);
+ #ifdef CONFIG_HOTPLUG_CPU
+ extern void unregister_cpu(struct cpu *, struct node *);
+ #endif
diff --git a/queue-2.6.16/driver-0023-sysfs-fix-a-kobject-leak-in-sysfs_add_link-on-the-error-path.patch b/queue-2.6.16/driver-0023-sysfs-fix-a-kobject-leak-in-sysfs_add_link-on-the-error-path.patch
new file mode 100644 (file)
index 0000000..e90452f
--- /dev/null
@@ -0,0 +1,27 @@
+From nobody Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@suse.de>
+Date: Thu Mar 16 15:44:26 2006 -0800
+Subject: [PATCH 23/23] sysfs: fix a kobject leak in sysfs_add_link on the error path
+
+As pointed out by Oliver Neukum.
+
+Cc: Maneesh Soni <maneesh@in.ibm.com>
+Cc: Oliver Neukum <oliver@neukum.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+
+ fs/sysfs/symlink.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+b3229087c5e08589cea4f5040dab56f7dc11332a
+--- linux-2.6.16.orig/fs/sysfs/symlink.c
++++ linux-2.6.16/fs/sysfs/symlink.c
+@@ -66,6 +66,7 @@ static int sysfs_add_link(struct dentry 
+       if (!error)
+               return 0;
++      kobject_put(target);
+       kfree(sl->link_name);
+ exit2:
+       kfree(sl);