浏览代码

ALSA: Optimize module name check

module->name is a fixed array, so we can check the empty contents
straightforwardly in module_slot_match().

Spotted by coverity CID 1056786.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 11 年之前
父节点
当前提交
60f6fef877
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      sound/core/init.c

+ 1 - 1
sound/core/init.c

@@ -66,7 +66,7 @@ static int module_slot_match(struct module *module, int idx)
 #ifdef MODULE
 	const char *s1, *s2;
 
-	if (!module || !module->name || !slots[idx])
+	if (!module || !*module->name || !slots[idx])
 		return 0;
 
 	s1 = module->name;