mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleksij Rempel <ore@pengutronix.de>
To: Guenter Roeck <linux@roeck-us.net>, Wim Van Sebroeck <wim@iguana.be>
Cc: Oleksij Rempel <o.rempel@pengutronix.de>,
	Steffen Trumtrar <s.trumtrar@pengutronix.de>,
	linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] watchdog: Fix potential kref imbalance when opening watchdog
Date: Tue, 26 Sep 2017 07:24:10 +0200	[thread overview]
Message-ID: <7f1bad2d-0f82-ee66-e9d2-c67fbe38950a@pengutronix.de> (raw)
In-Reply-To: <1506356222-528-1-git-send-email-linux@roeck-us.net>

On 25.09.2017 18:17, Guenter Roeck wrote:
> If a watchdog driver's open function sets WDOG_HW_RUNNING with the
> expectation that the watchdog can not be stopped, but then stops the
> watchdog anyway in its stop function, kref_get() wil not be called in
> watchdog_open(). If the watchdog then stops on close, WDOG_HW_RUNNING
> will be cleared and kref_put() will be called, causing a kref imbalance.
> As result the character device data structure will be released, which in
> turn will cause the system to crash on the next call to watchdog_open().

Ach, ok. I see. So the stop patch should remove it from the start.

      parent reply	other threads:[~2017-09-26  5:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-25 16:17 Guenter Roeck
2017-09-25 16:17 ` [PATCH 2/2] watchdog: Fix kref imbalance seen if handle_boot_enabled=0 Guenter Roeck
2017-09-26  5:24 ` Oleksij Rempel [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f1bad2d-0f82-ee66-e9d2-c67fbe38950a@pengutronix.de \
    --to=ore@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=o.rempel@pengutronix.de \
    --cc=s.trumtrar@pengutronix.de \
    --cc=wim@iguana.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®