[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>

authored by Greg KH and committed by Linus Torvalds 518e6540 099d44e8

+3 -1
+3 -1
drivers/base/bus.c
··· 180 up(&dev->sem); 181 put_device(dev); 182 } 183 - return err; 184 } 185 static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); 186
··· 180 up(&dev->sem); 181 put_device(dev); 182 } 183 + if (err) 184 + return err; 185 + return count; 186 } 187 static DRIVER_ATTR(bind, S_IWUSR, NULL, driver_bind); 188