Commit 518e6540 authored by Greg KH's avatar Greg KH Committed by Linus Torvalds

[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: default avatarGreg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 099d44e8
...@@ -180,7 +180,9 @@ static ssize_t driver_bind(struct device_driver *drv, ...@@ -180,7 +180,9 @@ static ssize_t driver_bind(struct device_driver *drv,
up(&dev->sem); up(&dev->sem);
put_device(dev); put_device(dev);
} }
if (err)
return err; return err;
return count;
} }
static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment