From: Greg Kroah-Hartman Date: Thu, 23 Mar 2006 18:24:17 +0000 (-0800) Subject: added new 2.6.16 driver core patches X-Git-Tag: v2.6.16.1~9^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e3453ee903ec35dbef4935f4015ea211f08598b9;p=thirdparty%2Fkernel%2Fstable-queue.git added new 2.6.16 driver core patches --- 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 index 00000000000..7921de41459 --- /dev/null +++ b/queue-2.6.16/driver-0001-sysfs-sysfs_remove_dir-needs-to-invalidate-the-dentry.patch @@ -0,0 +1,54 @@ +From nobody Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +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 +Cc: Paul Fulghum +Cc: Maneesh Soni +Signed-off-by: Greg Kroah-Hartman + +--- + + 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 index 00000000000..8b640dccd1c --- /dev/null +++ b/queue-2.6.16/driver-0014-firmware-fix-BUG-in-fw_realloc_buffer.patch @@ -0,0 +1,49 @@ +From nobody Mon Sep 17 00:00:00 2001 +From: Jeff Moyer +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 +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman + +--- + + 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 index 00000000000..0473dbdd005 --- /dev/null +++ b/queue-2.6.16/driver-0021-get_cpu_sysdev-signedness-fix.patch @@ -0,0 +1,39 @@ +From nobody Mon Sep 17 00:00:00 2001 +From: Andrew Morton +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 +Signed-off-by: Greg Kroah-Hartman + +--- + + 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 index 00000000000..e90452f4ff3 --- /dev/null +++ b/queue-2.6.16/driver-0023-sysfs-fix-a-kobject-leak-in-sysfs_add_link-on-the-error-path.patch @@ -0,0 +1,27 @@ +From nobody Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +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 +Cc: Oliver Neukum +Signed-off-by: Greg Kroah-Hartman + +--- + + 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);