From: Mauro Carvalho Chehab Date: Mon, 14 Dec 2009 05:56:15 +0000 (-0300) Subject: V4L/DVB (13639): ir-sysfs: Properly protect rc_tab changes with a lock X-Git-Tag: v2.6.34-rc1~280^2~355 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eecee32ac2c4b00b76cc8d99fd8d2b9fd54a283d;p=profile%2Fcommon%2Fkernel-common.git V4L/DVB (13639): ir-sysfs: Properly protect rc_tab changes with a lock Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c index a967381..d73589a 100644 --- a/drivers/media/IR/ir-sysfs.c +++ b/drivers/media/IR/ir-sysfs.c @@ -79,6 +79,7 @@ static ssize_t store_protocol(struct device *d, struct ir_input_dev *ir_dev = dev_get_drvdata(d); enum ir_type ir_type = IR_TYPE_UNKNOWN; int rc = -EINVAL; + unsigned long flags; char *buf; buf = strsep((char **) &data, "\n"); @@ -104,7 +105,9 @@ static ssize_t store_protocol(struct device *d, return -EINVAL; } + spin_lock_irqsave(&ir_dev->rc_tab.lock, flags); ir_dev->rc_tab.ir_type = ir_type; + spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); IR_dprintk(1, "Current protocol is %ld\n", ir_type);