> static int watchdog_release(struct inode *inode, struct file *file) > { > - int err; > + int err = -EBUSY; > + > + /* > + * We only stop the watchdog if we received the magic character > + * or if WDIOF_MAGICCLOSE is not set > + */ > + if (test_and_clear_bit(WDOG_ALLOW_RELEASE, &wdd->status) || > + !(wdd->info->options & WDIOF_MAGICCLOSE)) > + err = watchdog_stop(wdd); > > - /* stop the watchdog */ > - err = watchdog_stop(wdd); > + /* If the watchdog was not stopped, sent a keepalive ping */ s/sent/send/ > if (err < 0) { > pr_crit("%s: watchdog did not stop!\n", wdd->info->identity); > watchdog_ping(wdd); -- Pengutronix e.K. | Wolfram Sang | Industrial Linux Solutions | http://www.pengutronix.de/ |
Attachment:
signature.asc
Description: Digital signature