aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-25 23:02:00 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-07-25 23:02:00 -0300
commit72f0df1fd90b2ece5ce6c57433e36ec2386e262e (patch)
tree04287a872042181a6ca7eb5808aa61486dd060dc
parentdb13b6f812ba94c562f1ed61f1457844868c47a8 (diff)
keytable: Mask selected protocols with the supported ones
It should never try to enable a protocol not supported, as the Kernel will give an error and reset to none. That's a problem when -p all option is used. So, mask the protocols to make this option to work. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--utils/keytable/keytable.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index 6a8deeef..1a91fba0 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -1174,6 +1174,12 @@ static int set_proto(struct rc_device *rc_dev)
{
int rc = 0;
+ rc_dev->current &= rc_dev->supported;
+ if (!rc_dev->current) {
+ fprintf(stderr, "Invalid protocols selected\n");
+ return EINVAL;
+ }
+
if (rc_dev->version == VERSION_2) {
rc = v2_set_protocols(rc_dev);
return rc;

Privacy Policy