From: Greg Kroah-Hartman Date: Thu, 18 Aug 2005 00:33:11 +0000 (-0700) Subject: [PATCH] Fix manual binding infinite loop X-Git-Tag: v2.6.14-rc1~751^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d65da6eae10cc77f93ead0188cde0b45f124d912;p=platform%2Fkernel%2Flinux-exynos.git [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 for pointing the problem out. Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/bus.c b/drivers/base/bus.c index ab53832..6966aff 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);