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
This commit is contained in:
Linus Torvalds 2010-01-25 19:00:56 -08:00
commit c799d15333
4 changed files with 15 additions and 14 deletions

View File

@ -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;
}

View File

@ -1329,18 +1329,17 @@ 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;
} 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);
}
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);
}
ACPI_FREE(buf.pointer);
err = atk_probe_if(data);
if (err) {
dev_err(&device->dev, "No usable hwmon interface detected\n");

View File

@ -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 */

View File

@ -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();