summaryrefslogtreecommitdiffstats
path: root/drivers/media/IR
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-12-14 06:56:15 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-02-26 19:10:24 +0100
commiteecee32ac2c4b00b76cc8d99fd8d2b9fd54a283d (patch)
treeb76c3a68f773c7575b982b2f2f0dd70894f4306c /drivers/media/IR
parentV4L/DVB (13638): ir-core: documment missed functions (diff)
downloadlinux-eecee32ac2c4b00b76cc8d99fd8d2b9fd54a283d.tar.xz
linux-eecee32ac2c4b00b76cc8d99fd8d2b9fd54a283d.zip
V4L/DVB (13639): ir-sysfs: Properly protect rc_tab changes with a lock
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR')
-rw-r--r--drivers/media/IR/ir-sysfs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c
index a96738135bb0..d73589ad55e6 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);