All of lore.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] Driver Core fixes for 2.6.10-rc2
@ 2004-11-19 21:47 Greg KH
  2004-11-19 21:48 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2004-11-19 21:47 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are two bugfixes for the driver core / sysfs against 2.6.10-rc2.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/driver-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.

 fs/sysfs/dir.c |    3 ++-
 lib/kobject.c  |    6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)
-----


Gerd Knorr:
  o fix kobject varargs bug

Maneesh Soni:
  o fix oops in sysfs_remove_dir()


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] Driver Core fixes for 2.6.10-rc2
  2004-11-19 21:47 [BK PATCH] Driver Core fixes for 2.6.10-rc2 Greg KH
@ 2004-11-19 21:48 ` Greg KH
  2004-11-19 21:49   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2004-11-19 21:48 UTC (permalink / raw)
  To: linux-kernel


ChangeSet 1.2164, 2004/11/19 08:47:13-08:00, akpm@osdl.org

[PATCH] fix kobject varargs bug

From: Gerd Knorr <kraxel@bytesex.org>

It uses the varargs list twice in a illegal way.  That doesn't harm on i386
by pure luck, but blows things up on amd64 machines.

Using var args list twice without calling va_start twice is illegal.

Signed-off-by: Gerd Knorr <kraxel@bytesex.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 lib/kobject.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


diff -Nru a/lib/kobject.c b/lib/kobject.c
--- a/lib/kobject.c	2004-11-19 11:36:44 -08:00
+++ b/lib/kobject.c	2004-11-19 11:36:44 -08:00
@@ -232,11 +232,12 @@
 	va_list args;
 	char * name;
 
-	va_start(args,fmt);
 	/* 
 	 * First, try the static array 
 	 */
+	va_start(args,fmt);
 	need = vsnprintf(kobj->name,limit,fmt,args);
+	va_end(args);
 	if (need < limit) 
 		name = kobj->name;
 	else {
@@ -249,7 +250,9 @@
 			error = -ENOMEM;
 			goto Done;
 		}
+		va_start(args,fmt);
 		need = vsnprintf(name,limit,fmt,args);
+		va_end(args);
 
 		/* Still? Give up. */
 		if (need >= limit) {
@@ -266,7 +269,6 @@
 	/* Now, set the new name */
 	kobj->k_name = name;
  Done:
-	va_end(args);
 	return error;
 }
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Driver Core fixes for 2.6.10-rc2
  2004-11-19 21:48 ` [PATCH] " Greg KH
@ 2004-11-19 21:49   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-11-19 21:49 UTC (permalink / raw)
  To: linux-kernel


ChangeSet 1.2165, 2004/11/19 08:47:38-08:00, maneesh@in.ibm.com

[PATCH] fix oops in sysfs_remove_dir()

The following patch should avoid the sysfs_remove_dir() oops you are
seeing while device removal. It anyway fixes the obvious error and is
needed. But it will not make any change to the first error you are
seeing while connecting the device.


o Following patch avoids the sysfs_remove_dir() oops when it is passed
  a kobject with NULL dentry.

Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 fs/sysfs/dir.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)


diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c	2004-11-19 11:36:39 -08:00
+++ b/fs/sysfs/dir.c	2004-11-19 11:36:39 -08:00
@@ -268,7 +268,7 @@
 void sysfs_remove_dir(struct kobject * kobj)
 {
 	struct dentry * dentry = dget(kobj->dentry);
-	struct sysfs_dirent * parent_sd = dentry->d_fsdata;
+	struct sysfs_dirent * parent_sd;
 	struct sysfs_dirent * sd, * tmp;
 
 	if (!dentry)
@@ -276,6 +276,7 @@
 
 	pr_debug("sysfs %s: removing dir\n",dentry->d_name.name);
 	down(&dentry->d_inode->i_sem);
+	parent_sd = dentry->d_fsdata;
 	list_for_each_entry_safe(sd, tmp, &parent_sd->s_children, s_sibling) {
 		if (!sd->s_element || !(sd->s_type & SYSFS_NOT_PINNED))
 			continue;

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-19 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-19 21:47 [BK PATCH] Driver Core fixes for 2.6.10-rc2 Greg KH
2004-11-19 21:48 ` [PATCH] " Greg KH
2004-11-19 21:49   ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.