Skip to contentSkip to conversation

Fix sysfs rc protocol lookup for rc-5-sz

PATCH New Antti Seppälä 1 participant 1 message Feb 13, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix sysfs rc protocol lookup for rc-5-sz

With the current matching rules the lookup for rc protocol named rc-5-sz matches with "rc-5" before finding "rc-5-sz". Thus one is able to never enable/disable the rc-5-sz protocol via sysfs.

Fix the lookup to require an exact match which allows the manipulation of sz protocol.

---
 drivers/media/rc/rc-main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/rc/rc-main.c +1 -1
index 512a2f4..5b4422e 100644
@@ -850,7 +850,7 @@ static ssize_t store_protocols(struct device *device,
 			count++;
 		} else {
 			for (i = 0; i < ARRAY_SIZE(proto_names); i++) {
-				if (!strncasecmp(tmp, proto_names[i].name, strlen(proto_names[i].name))) {
+				if (!strcasecmp(tmp, proto_names[i].name)) {
 					tmp += strlen(proto_names[i].name);
 					mask = proto_names[i].type;
 					break;
Signature · 1 line
1.7.3.4