err variable is used only once with -EBUSY, so move it to proper place to prevent useless ticks consuming. Signed-off-by: Tony Zelenoff <antonz@xxxxxxxxxxxxx> --- drivers/watchdog/watchdog_dev.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c index e89b9d3..e43bbaa 100644 --- a/drivers/watchdog/watchdog_dev.c +++ b/drivers/watchdog/watchdog_dev.c @@ -427,7 +427,7 @@ EXPORT_SYMBOL_GPL(watchdog_may_open); static int watchdog_open(struct inode *inode, struct file *file) { - int err = -EBUSY; + int err; struct watchdog_device *wdd; if (!watchdog_may_open()) @@ -447,8 +447,10 @@ static int watchdog_open(struct inode *inode, struct file *file) * If the /dev/watchdog device is open, we don't want the module * to be unloaded. */ - if (!try_module_get(wdd->ops->owner)) + if (!try_module_get(wdd->ops->owner)) { + err = -EBUSY; goto out; + } err = watchdog_start(wdd); if (err < 0) -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html