public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix manual binding infinite loop
@ 2005-08-18  0:33 Greg KH
  0 siblings, 0 replies; only message in thread
From: Greg KH @ 2005-08-18  0:33 UTC (permalink / raw)
  To: torvalds, Andrew Morton; +Cc: Michal Ostrowski, linux-kernel

Fix for manual binding of drivers to devices.  Problem is if you pass in
a valid device id, but the driver refuses to bind.  Infinite loop as
write() tries to resubmit the data it just sent.

Thanks to Michal Ostrowski <mostrows@watson.ibm.com> for pointing the
problem out.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/base/bus.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

--- gregkh-2.6.orig/drivers/base/bus.c	2005-08-02 13:41:26.000000000 -0700
+++ gregkh-2.6/drivers/base/bus.c	2005-08-17 17:11:35.000000000 -0700
@@ -180,7 +180,9 @@ static ssize_t driver_bind(struct device
 		up(&dev->sem);
 		put_device(dev);
 	}
-	return err;
+	if (err)
+		return err;
+	return count;
 }
 static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
 
-- 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-18  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-18  0:33 [PATCH] Fix manual binding infinite loop Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox