diff options
author | Guenter Roeck <linux@roeck-us.net> | 2017-09-25 19:17:01 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@iguana.be> | 2017-12-17 13:01:47 +0300 |
commit | 4bcd615fad6adddc68b058d498b30a9e0e0db77a (patch) | |
tree | 2147795c91515080182841b24959a0416bcae594 /lib | |
parent | f3b5ad89de16f5d42e8ad36fbdf85f705c1ae051 (diff) | |
download | linux-4bcd615fad6adddc68b058d498b30a9e0e0db77a.tar.xz |
watchdog: Fix potential kref imbalance when opening watchdog
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().
Fixes: ee142889e32f5 ("watchdog: Introduce WDOG_HW_RUNNING flag")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions