Skip to content

Commit

Permalink
[PATCH] Fix manual binding infinite loop
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Greg KH authored and Linus Torvalds committed Aug 18, 2005
1 parent 099d44e commit 518e654
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 518e654

Please sign in to comment.