summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/fschmd.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2010-01-29 09:24:57 +0100
committerIngo Molnar <mingo@elte.hu>2010-01-29 10:36:22 +0100
commitae7f6711d6231c9ba54feb5ba9856c3775e482f8 (patch)
tree89070c82204b2503348e4fd6c51d25a169375545 /drivers/hwmon/fschmd.c
parent64abebf731df87e6f4ae7d9ffc340bdf0c033e44 (diff)
parentb23ff0e9330e4b11e18af984d50573598e10e7f9 (diff)
downloadlinux-ae7f6711d6231c9ba54feb5ba9856c3775e482f8.tar.bz2
Merge branch 'perf/urgent' into perf/core
Merge reason: We want to queue up a dependent patch. Also update to later -rc's. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/hwmon/fschmd.c')
-rw-r--r--drivers/hwmon/fschmd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c
index bd0fc67e804b..fa0728232e71 100644
--- a/drivers/hwmon/fschmd.c
+++ b/drivers/hwmon/fschmd.c
@@ -768,6 +768,7 @@ leave:
static int watchdog_open(struct inode *inode, struct file *filp)
{
struct fschmd_data *pos, *data = NULL;
+ int watchdog_is_open;
/* We get called from drivers/char/misc.c with misc_mtx hold, and we
call misc_register() from fschmd_probe() with watchdog_data_mutex
@@ -782,10 +783,12 @@ static int watchdog_open(struct inode *inode, struct file *filp)
}
}
/* Note we can never not have found data, so we don't check for this */
- kref_get(&data->kref);
+ watchdog_is_open = test_and_set_bit(0, &data->watchdog_is_open);
+ if (!watchdog_is_open)
+ kref_get(&data->kref);
mutex_unlock(&watchdog_data_mutex);
- if (test_and_set_bit(0, &data->watchdog_is_open))
+ if (watchdog_is_open)
return -EBUSY;
/* Start the watchdog */