summaryrefslogtreecommitdiff
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-08-18 04:33:11 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-09-06 03:03:09 +0400
commitd65da6eae10cc77f93ead0188cde0b45f124d912 (patch)
tree2494fac5df0711f16cd4d49cc25133ea9d99b5e7 /drivers/base/bus.c
parent67d2c36e901403bb97cb79ddb44d702c3284d0ba (diff)
downloadlinux-d65da6eae10cc77f93ead0188cde0b45f124d912.tar.xz
[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>
Diffstat (limited to 'drivers/base/bus.c')
-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 ab53832d57e5..6966aff74efe 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -156,7 +156,9 @@ static ssize_t driver_unbind(struct device_driver *drv,
device_release_driver(dev);
err = count;
}
- return err;
+ if (err)
+ return err;
+ return count;
}
static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);