diff options
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r-- | drivers/acpi/utilities/utmisc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c index f0275025b718..0c5abc536c7a 100644 --- a/drivers/acpi/utilities/utmisc.c +++ b/drivers/acpi/utilities/utmisc.c | |||
@@ -67,6 +67,14 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
67 | 67 | ||
68 | ACPI_FUNCTION_TRACE("ut_allocate_owner_id"); | 68 | ACPI_FUNCTION_TRACE("ut_allocate_owner_id"); |
69 | 69 | ||
70 | /* Guard against multiple allocations of ID to the same location */ | ||
71 | |||
72 | if (*owner_id) { | ||
73 | ACPI_REPORT_ERROR(("Owner ID [%2.2X] already exists\n", | ||
74 | *owner_id)); | ||
75 | return_ACPI_STATUS(AE_ALREADY_EXISTS); | ||
76 | } | ||
77 | |||
70 | /* Mutex for the global ID mask */ | 78 | /* Mutex for the global ID mask */ |
71 | 79 | ||
72 | status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES); | 80 | status = acpi_ut_acquire_mutex(ACPI_MTX_CACHES); |
@@ -80,7 +88,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) | |||
80 | if (!(acpi_gbl_owner_id_mask & (1 << i))) { | 88 | if (!(acpi_gbl_owner_id_mask & (1 << i))) { |
81 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, | 89 | ACPI_DEBUG_PRINT((ACPI_DB_VALUES, |
82 | "Current owner_id mask: %8.8X New ID: %2.2X\n", | 90 | "Current owner_id mask: %8.8X New ID: %2.2X\n", |
83 | acpi_gbl_owner_id_mask, (i + 1))); | 91 | acpi_gbl_owner_id_mask, |
92 | (unsigned int)(i + 1))); | ||
84 | 93 | ||
85 | acpi_gbl_owner_id_mask |= (1 << i); | 94 | acpi_gbl_owner_id_mask |= (1 << i); |
86 | *owner_id = (acpi_owner_id) (i + 1); | 95 | *owner_id = (acpi_owner_id) (i + 1); |
@@ -143,7 +152,9 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr) | |||
143 | return_VOID; | 152 | return_VOID; |
144 | } | 153 | } |
145 | 154 | ||
146 | owner_id--; /* Normalize to zero */ | 155 | /* Normalize the ID to zero */ |
156 | |||
157 | owner_id--; | ||
147 | 158 | ||
148 | /* Free the owner ID only if it is valid */ | 159 | /* Free the owner ID only if it is valid */ |
149 | 160 | ||