Thread (3 messages) flat view 3 messages, 2 authors, 2012-12-12

Re: [PATCH] HID: i2c-hid: add mutex protecting open/close race

From: Benjamin Tissoires <hidden>
Date: 2012-12-12 16:54:25
Also in: linux-i2c, lkml

On Wed, Dec 12, 2012 at 5:34 PM, Jean Delvare [off-list ref] wrote:
Hi Benjamin,

On Wed, 12 Dec 2012 17:12:16 +0100, Benjamin Tissoires wrote:
quoted
We should not enter close function while someone else is in open.
This mutex prevents this race.

There is also no need to override the ret value with -EIO in case of
a failure of i2c_hid_set_power.

Signed-off-by: Benjamin Tissoires <redacted>
---
Looks good to me except that you forgot to include <linux/mutex.h> and
this could cause build failures on some architectures/configs.

Once this is fixed, you can add:

Reviewed-by: Jean Delvare <redacted>
Thanks, I will resend it right now.

Cheers,
Benjamin
--
Jean Delvare
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help