Commit 70fd4199 authored by Andy Grover's avatar Andy Grover

ACPI: Fix oops on module insert/remove (Matthew Tippett)

parent 4749dedc
...@@ -183,8 +183,10 @@ acpi_ac_remove_fs ( ...@@ -183,8 +183,10 @@ acpi_ac_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_ac_remove_fs"); ACPI_FUNCTION_TRACE("acpi_ac_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_ac_dir); remove_proc_entry(acpi_device_bid(device), acpi_ac_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -669,8 +669,10 @@ acpi_battery_remove_fs ( ...@@ -669,8 +669,10 @@ acpi_battery_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_battery_remove_fs"); ACPI_FUNCTION_TRACE("acpi_battery_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_battery_dir); remove_proc_entry(acpi_device_bid(device), acpi_battery_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -179,8 +179,10 @@ acpi_button_remove_fs ( ...@@ -179,8 +179,10 @@ acpi_button_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_button_remove_fs"); ACPI_FUNCTION_TRACE("acpi_button_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_button_dir); remove_proc_entry(acpi_device_bid(device), acpi_button_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -181,8 +181,10 @@ acpi_fan_remove_fs ( ...@@ -181,8 +181,10 @@ acpi_fan_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_fan_remove_fs"); ACPI_FUNCTION_TRACE("acpi_fan_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_fan_dir); remove_proc_entry(acpi_device_bid(device), acpi_fan_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -467,8 +467,10 @@ acpi_power_remove_fs ( ...@@ -467,8 +467,10 @@ acpi_power_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_power_remove_fs"); ACPI_FUNCTION_TRACE("acpi_power_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_power_dir); remove_proc_entry(acpi_device_bid(device), acpi_power_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -2348,8 +2348,10 @@ acpi_processor_remove_fs ( ...@@ -2348,8 +2348,10 @@ acpi_processor_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_processor_remove_fs"); ACPI_FUNCTION_TRACE("acpi_processor_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_processor_dir); remove_proc_entry(acpi_device_bid(device), acpi_processor_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
...@@ -1123,8 +1123,10 @@ acpi_thermal_remove_fs ( ...@@ -1123,8 +1123,10 @@ acpi_thermal_remove_fs (
{ {
ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs"); ACPI_FUNCTION_TRACE("acpi_thermal_remove_fs");
if (acpi_device_dir(device)) if (acpi_device_dir(device)) {
remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir); remove_proc_entry(acpi_device_bid(device), acpi_thermal_dir);
acpi_device_dir(device) = NULL;
}
return_VALUE(0); return_VALUE(0);
} }
......
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