lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Sat,  1 Sep 2012 09:57:09 +0800
From:	"Du, Changbin" <changbin.du@...il.com>
To:	mchehab@...radead.org
Cc:	paul.gortmaker@...driver.com, sfr@...b.auug.org.au,
	srinivas.kandagatla@...com, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	"Du, Changbin" <changbin.du@...il.com>
Subject: [RFC PATCH] [media] rc: filter out not allowed protocols when decoding

From: "Du, Changbin" <changbin.du@...il.com>

Each rc-raw device has a property "allowed_protos" stored in structure
ir_raw_event_ctrl. But it didn't work because all decoders would be
called when decoding. This path makes only allowed protocol decoders
been invoked.

Signed-off-by: Du, Changbin <changbin.du@...il.com>
---
 drivers/media/rc/ir-raw.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/media/rc/ir-raw.c b/drivers/media/rc/ir-raw.c
index a820251..198b6d8 100644
--- a/drivers/media/rc/ir-raw.c
+++ b/drivers/media/rc/ir-raw.c
@@ -63,8 +63,12 @@ static int ir_raw_event_thread(void *data)
 		spin_unlock_irq(&raw->lock);
 
 		mutex_lock(&ir_raw_handler_lock);
-		list_for_each_entry(handler, &ir_raw_handler_list, list)
-			handler->decode(raw->dev, ev);
+		list_for_each_entry(handler, &ir_raw_handler_list, list) {
+			/* use all protocol by default */
+			if (raw->dev->allowed_protos == RC_TYPE_UNKNOWN ||
+			    raw->dev->allowed_protos & handler->protocols)
+				handler->decode(raw->dev, ev);
+		}
 		raw->prev_ev = ev;
 		mutex_unlock(&ir_raw_handler_lock);
 	}
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ