V4L/DVB: ir-core: Fix null dereferences in the protocols sysfs interface
authorBrian Rogers <brian@xyzw.org>
Wed, 22 Sep 2010 11:06:43 +0000 (08:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 30 Sep 2010 10:18:37 +0000 (07:18 -0300)
commita08c7c68f702e2a2797a4035b6c0a756c4886c26
tree4761de745c2260d5832241f82d41d9985e79addb
parentddc79e0fdc16c05c3ff7f9b6ae9052bda0506108
V4L/DVB: ir-core: Fix null dereferences in the protocols sysfs interface

For some cards, ir_dev->props and ir_dev->raw are both NULL. These cards are
using built-in IR decoding instead of raw, and can't easily be made to switch
protocols.

So upon reading /sys/class/rc/rc?/protocols on such a card, return 'builtin' as
the supported and enabled protocol. Return -EINVAL on any attempts to change
the protocol. And most important of all, don't crash.

Signed-off-by: Brian Rogers <brian@xyzw.org>
Acked-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/IR/ir-sysfs.c