[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK5ve-+gmOEAKjSnKaWz2K_xs6LzDUP6LN2Y33J-22UV=eFM2Q@mail.gmail.com>
Date: Thu, 3 Jul 2014 11:13:09 -0700
From: Bryan Wu <cooloney@...il.com>
To: Johan Hovold <johan@...nel.org>
Cc: Janne Kanniainen <janne.kanniainen@...il.com>,
Jiri Kosina <jkosina@...e.cz>,
Greg Kroah-Hartman <greg@...ah.com>,
Bjørn Mork <bjorn@...k.no>,
lkml <linux-kernel@...r.kernel.org>,
Linux LED Subsystem <linux-leds@...r.kernel.org>,
linux-usb@...r.kernel.org,
"linux-input@...r.kernel.org" <linux-input@...r.kernel.org>
Subject: Re: [PATCH 1/2 v6] HID: gt683r: fix race condition
On Thu, Jul 3, 2014 at 10:34 AM, Johan Hovold <johan@...nel.org> wrote:
> On Thu, Jul 03, 2014 at 08:17:08PM +0300, Janne Kanniainen wrote:
>> This will fix race condition noticed by Oliver Neukum. Sysfs files are
>> created before mutex and work are initialized.
>>
>> Signed-off-by: Janne Kanniainen <janne.kanniainen@...il.com>
>
> Reviewed-by: Johan Hovold <johan@...nel.org>
>
Good, merged to my tree.
-Bryan
>> ---
>> drivers/hid/hid-gt683r.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/hid/hid-gt683r.c b/drivers/hid/hid-gt683r.c
>> index 077f7a1..073bd80 100644
>> --- a/drivers/hid/hid-gt683r.c
>> +++ b/drivers/hid/hid-gt683r.c
>> @@ -227,6 +227,9 @@ static int gt683r_led_probe(struct hid_device *hdev,
>> if (!led)
>> return -ENOMEM;
>>
>> + mutex_init(&led->lock);
>> + INIT_WORK(&led->work, gt683r_led_work);
>> +
>> led->mode = GT683R_LED_NORMAL;
>> led->hdev = hdev;
>> hid_set_drvdata(hdev, led);
>> @@ -271,9 +274,6 @@ static int gt683r_led_probe(struct hid_device *hdev,
>> goto fail;
>> }
>>
>> - mutex_init(&led->lock);
>> - INIT_WORK(&led->work, gt683r_led_work);
>> -
>> return 0;
>>
>> fail:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists