From: Matt Roper <matthew.d.roper@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Subject: [igt-dev] [PATCH i-g-t] lib/igt_kmod: Fix uninitialized variable during module unload
Date: Thu, 16 Nov 2023 16:17:04 -0800 [thread overview]
Message-ID: <20231117001704.2816232-1-matthew.d.roper@intel.com> (raw)
When unloading a module with no holders, the 'err' variable is checked
without ever being initialized.
Noticed due to sporadic failures in
igt@xe_module_load@reload-no-display, although other tests may also have
been impacted.
Fixes: 5d4730e7f ("lib/igt_kmod: Allow some leeway in igt_kmod_unload_r")
Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@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 e967c9bcd..250ab2107 100644
--- a/lib/igt_kmod.c
+++ b/lib/igt_kmod.c
@@ -263,7 +263,7 @@ static int igt_kmod_unload_r(struct kmod_module *kmod, unsigned int flags)
#define MAX_TRIES 20
#define SLEEP_DURATION 500000
struct kmod_list *holders, *pos;
- int err, tries;
+ int err = 0, tries;
const char *mod_name = kmod_module_get_name(kmod);
if (kmod_module_get_initstate(kmod) == KMOD_MODULE_BUILTIN)
--
2.41.0
next reply other threads:[~2023-11-17 0:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-17 0:17 Matt Roper [this message]
2023-11-17 0:50 ` [igt-dev] ✗ GitLab.Pipeline: warning for lib/igt_kmod: Fix uninitialized variable during module unload Patchwork
2023-11-17 1:36 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-11-17 12:35 ` [igt-dev] [PATCH i-g-t] " Kamil Konieczny
2023-11-17 14:51 ` Cavitt, Jonathan
2023-11-17 22:53 ` [igt-dev] ✓ Fi.CI.IGT: success for " Patchwork
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=20231117001704.2816232-1-matthew.d.roper@intel.com \
--to=matthew.d.roper@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
/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