[PATCH] Fix manual binding infinite loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <[email protected]> for pointing the
problem out.

Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 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);
 
-- 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux