Re: [PATCH 1/1] HWMON: amc6821, fix lock imbalance

From: Jean Delvare
Date: Sat Jan 16 2010 - 05:03:14 EST


On Sat, 16 Jan 2010 10:28:01 +0100, Jiri Slaby wrote:
> Stanse found a lock imbalance in set_fan1_div. data->update_lock
> is unlocked twice on a fail path.
>
> Triggerable by writing value other than 2 and 4 to fan1_div.
>
> Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
> Cc: Tomaz Mertelj <tomaz.mertelj@xxxxxxxxxxxxxx>
> Cc: Jean Delvare <khali@xxxxxxxxxxxx>
> Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> ---
> drivers/hwmon/amc6821.c | 1 -
> 1 files changed, 0 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c
> index 1c89d92..fa9708c 100644
> --- a/drivers/hwmon/amc6821.c
> +++ b/drivers/hwmon/amc6821.c
> @@ -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;
> }

Patch pending in my queue already.
ftp://ftp.kernel.org/pub/linux/kernel/people/jdelvare/linux-2.6/jdelvare-hwmon/hwmon-amc6821-double-unlock-bug.patch

But thanks for reporting anyway.

--
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/