Commit a3228b34 authored by Chris Wilson's avatar Chris Wilson

igt/pm_rpm: Close local fd before trying to unload module

Make sure everything we open in setup_environment() is paired to
teardown_environment().

Fixes: d8e78990 ("igt/pm_rpm: Test reaquisition of runtime-pm after module reload")
Signed-off-by: Chris Wilson's avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Imre Deak's avatarImre Deak <imre.deak@intel.com>
parent 940cb5f4
......@@ -717,21 +717,23 @@ out:
return wait_for_suspended();
}
static void restore_environment(void)
static void teardown_environment(void)
{
close(msr_fd);
if (has_pc8)
close(pc8_status_fd);
igt_restore_runtime_pm();
igt_pm_restore_sata_link_power_management(pm_data);
free(pm_data);
}
static void teardown_environment(void)
{
restore_environment();
fini_mode_set_data(&ms_data);
close(debugfs);
drmClose(drm_fd);
close(msr_fd);
if (has_pc8)
close(pc8_status_fd);
close(drm_fd);
has_runtime_pm = false;
}
static void basic_subtest(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment