All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t] lib/igt_kmod: Compare module names with strcmp
@ 2017-02-03 10:09 Ander Conselvan de Oliveira
  2017-02-03 10:24 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Ander Conselvan de Oliveira @ 2017-02-03 10:09 UTC (permalink / raw)
  To: intel-gfx; +Cc: Ander Conselvan de Oliveira

The function igt_kmod_is_loaded() returns the wrong value when there is
a module loaded whose name is a prefix of the name supplied as a
paremter. For instance, if the "snd" module is loaded,
igt_kmod_is_load("snd_hda_intel") will return true even if that module
isn't loaded, thus causing drv_module_reload to failure in that
scenario.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
 lib/igt_kmod.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kmod.c b/lib/igt_kmod.c
index 657a0e5..5981700 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -91,7 +91,7 @@ igt_kmod_is_loaded(const char *mod_name)
 		struct kmod_module *kmod = kmod_module_get_module(mod);
 		const char *kmod_name = kmod_module_get_name(kmod);
 
-		if (!strncmp(kmod_name, mod_name, strlen(kmod_name))) {
+		if (!strcmp(kmod_name, mod_name)) {
 			kmod_module_unref(kmod);
 			ret = true;
 			break;
-- 
2.9.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-03 10:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-03 10:09 [PATCH i-g-t] lib/igt_kmod: Compare module names with strcmp Ander Conselvan de Oliveira
2017-02-03 10:24 ` Chris Wilson
2017-02-03 10:44   ` Ander Conselvan De Oliveira

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.