Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/igt_kmod: Fix uninitialized variable during module unload
@ 2023-11-17  0:17 Matt Roper
  2023-11-17  0:50 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matt Roper @ 2023-11-17  0:17 UTC (permalink / raw)
  To: igt-dev; +Cc: Jonathan Cavitt

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

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

end of thread, other threads:[~2023-11-17 22:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17  0:17 [igt-dev] [PATCH i-g-t] lib/igt_kmod: Fix uninitialized variable during module unload Matt Roper
2023-11-17  0:50 ` [igt-dev] ✗ GitLab.Pipeline: warning for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox