[PATCH] keytable: fix segfault when RC driver's module_name is null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some dvb-usb drivers do not set a proper module_name in their rc.core struct
(e.g. the ttusb2 module and various dib0700 submodules as of 2.6.39).
Auto-load mode was segfaulting if trying to match those drivers with a * value.

Signed-off-by: CÃdric Schieli <cschieli@xxxxxxxxx>
---
 utils/keytable/keytable.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/keytable/keytable.c b/utils/keytable/keytable.c
index c406a18..13df13b 100644
--- a/utils/keytable/keytable.c
+++ b/utils/keytable/keytable.c
@@ -1427,9 +1427,9 @@ int main(int argc, char *argv[])
 		int rc;
 
 		for (cur = &cfg; cur->next; cur = cur->next) {
-			if (strcasecmp(cur->driver, rc_dev.drv_name) && strcasecmp(cur->driver, "*"))
+			if ((!rc_dev.drv_name || strcasecmp(cur->driver, rc_dev.drv_name)) && strcasecmp(cur->driver, "*"))
 				continue;
-			if (strcasecmp(cur->table, rc_dev.keytable_name) && strcasecmp(cur->table, "*"))
+			if ((!rc_dev.keytable_name || strcasecmp(cur->table, rc_dev.keytable_name)) && strcasecmp(cur->table, "*"))
 				continue;
 			break;
 		}
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux