diff options
author | H. Peter Anvin <hpa@zytor.com> | 2010-02-22 19:20:34 -0500 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2010-02-22 19:20:34 -0500 |
commit | d02e30c31c57683a66ed68a1bcff900ca78f6d56 (patch) | |
tree | c3ce99a00061bcc1199b50fa838147d876c56717 /drivers/hwmon/fschmd.c | |
parent | 0fdc7a8022c3eaff6b5ee27ffb9e913e5e58d8e9 (diff) | |
parent | aef55d4922e62a0d887e60d87319f3718aec6ced (diff) |
Merge branch 'x86/irq' into x86/apic
Merge reason:
Conflicts in arch/x86/kernel/apic/io_apic.c
Resolved Conflicts:
arch/x86/kernel/apic/io_apic.c
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'drivers/hwmon/fschmd.c')
-rw-r--r-- | drivers/hwmon/fschmd.c | 7 |
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: | |||
768 | static int watchdog_open(struct inode *inode, struct file *filp) | 768 | static int watchdog_open(struct inode *inode, struct file *filp) |
769 | { | 769 | { |
770 | struct fschmd_data *pos, *data = NULL; | 770 | struct fschmd_data *pos, *data = NULL; |
771 | int watchdog_is_open; | ||
771 | 772 | ||
772 | /* We get called from drivers/char/misc.c with misc_mtx hold, and we | 773 | /* We get called from drivers/char/misc.c with misc_mtx hold, and we |
773 | call misc_register() from fschmd_probe() with watchdog_data_mutex | 774 | call misc_register() from fschmd_probe() with watchdog_data_mutex |
@@ -782,10 +783,12 @@ static int watchdog_open(struct inode *inode, struct file *filp) | |||
782 | } | 783 | } |
783 | } | 784 | } |
784 | /* Note we can never not have found data, so we don't check for this */ | 785 | /* Note we can never not have found data, so we don't check for this */ |
785 | kref_get(&data->kref); | 786 | watchdog_is_open = test_and_set_bit(0, &data->watchdog_is_open); |
787 | if (!watchdog_is_open) | ||
788 | kref_get(&data->kref); | ||
786 | mutex_unlock(&watchdog_data_mutex); | 789 | mutex_unlock(&watchdog_data_mutex); |
787 | 790 | ||
788 | if (test_and_set_bit(0, &data->watchdog_is_open)) | 791 | if (watchdog_is_open) |
789 | return -EBUSY; | 792 | return -EBUSY; |
790 | 793 | ||
791 | /* Start the watchdog */ | 794 | /* Start the watchdog */ |