From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Subject: [PATCH i-g-t] lib/igt_kmod: Compare module names with strcmp
Date: Fri, 3 Feb 2017 12:09:46 +0200 [thread overview]
Message-ID: <20170203100946.8789-1-ander.conselvan.de.oliveira@intel.com> (raw)
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
next reply other threads:[~2017-02-03 10:10 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 10:09 Ander Conselvan de Oliveira [this message]
2017-02-03 10:24 ` [PATCH i-g-t] lib/igt_kmod: Compare module names with strcmp Chris Wilson
2017-02-03 10:44 ` Ander Conselvan De Oliveira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170203100946.8789-1-ander.conselvan.de.oliveira@intel.com \
--to=ander.conselvan.de.oliveira@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox