[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>
This commit is contained in:
Greg Kroah-Hartman 2005-08-17 17:33:11 -07:00
parent 67d2c36e90
commit d65da6eae1
1 changed files with 3 additions and 1 deletions

View File

@ -156,7 +156,9 @@ static ssize_t driver_unbind(struct device_driver *drv,
device_release_driver(dev); device_release_driver(dev);
err = count; err = count;
} }
return err; if (err)
return err;
return count;
} }
static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind); static DRIVER_ATTR(unbind, S_IWUSR, NULL, driver_unbind);