Commit c799d153 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  hwmon: (fschmd) Fix a memleak on multiple opens of /dev/watchdog
  hwmon: (asus_atk0110) Do not fail if MBIF is missing
  hwmon: (amc6821) Double unlock bug
  hwmon: (smsc47m1) Fix section mismatch
parents abefedd5 c453615f
......@@ -686,7 +686,6 @@ static ssize_t set_fan1_div(
data->fan1_div = 4;
break;
default:
mutex_unlock(&data->update_lock);
count = -EINVAL;
goto EXIT;
}
......
......@@ -1329,17 +1329,16 @@ static int atk_add(struct acpi_device *device)
&buf, ACPI_TYPE_PACKAGE);
if (ret != AE_OK) {
dev_dbg(&device->dev, "atk: method MBIF not found\n");
err = -ENODEV;
goto out;
}
obj = buf.pointer;
if (obj->package.count >= 2 &&
obj->package.elements[1].type == ACPI_TYPE_STRING) {
dev_dbg(&device->dev, "board ID = %s\n",
obj->package.elements[1].string.pointer);
} else {
obj = buf.pointer;
if (obj->package.count >= 2) {
union acpi_object *id = &obj->package.elements[1];
if (id->type == ACPI_TYPE_STRING)
dev_dbg(&device->dev, "board ID = %s\n",
id->string.pointer);
}
ACPI_FREE(buf.pointer);
}
ACPI_FREE(buf.pointer);
err = atk_probe_if(data);
if (err) {
......
......@@ -768,6 +768,7 @@ static int watchdog_stop(struct fschmd_data *data)
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 */
......
......@@ -488,7 +488,7 @@ static int __init smsc47m1_find(unsigned short *addr,
}
/* Restore device to its initial state */
static void __init smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
static void smsc47m1_restore(const struct smsc47m1_sio_data *sio_data)
{
if ((sio_data->activate & 0x01) == 0) {
superio_enter();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment