summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorGreg KH2005-08-18 02:33:11 +0200
committerLinus Torvalds2005-08-18 07:02:25 +0200
commit518e6540831c69422faecceee8f964bd439ac9d0 (patch)
tree0b31e27c6007adac51c8e6e3a832badc1d8e2a1a /drivers/base
parentMerge master.kernel.org:/pub/scm/linux/kernel/git/aia21/ntfs-2.6 (diff)
downloadkernel-qcow2-linux-518e6540831c69422faecceee8f964bd439ac9d0.tar.gz
kernel-qcow2-linux-518e6540831c69422faecceee8f964bd439ac9d0.tar.xz
kernel-qcow2-linux-518e6540831c69422faecceee8f964bd439ac9d0.zip
[PATCH] Fix manual binding infinite loop
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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/bus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 96fe2f956754..ab53832d57e5 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -180,7 +180,9 @@ static ssize_t driver_bind(struct device_driver *drv,
up(&dev->sem);
put_device(dev);
}
- return err;
+ if (err)
+ return err;
+ return count;
}
static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);