diff options
| -rw-r--r-- | drivers/acpi/scan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index d2e3c3e3f9c9..69bc0d888c01 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -247,6 +247,7 @@ static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias, | |||
| 247 | static struct acpi_device *acpi_companion_match(const struct device *dev) | 247 | static struct acpi_device *acpi_companion_match(const struct device *dev) |
| 248 | { | 248 | { |
| 249 | struct acpi_device *adev; | 249 | struct acpi_device *adev; |
| 250 | struct mutex *physical_node_lock; | ||
| 250 | 251 | ||
| 251 | adev = ACPI_COMPANION(dev); | 252 | adev = ACPI_COMPANION(dev); |
| 252 | if (!adev) | 253 | if (!adev) |
| @@ -255,7 +256,8 @@ static struct acpi_device *acpi_companion_match(const struct device *dev) | |||
| 255 | if (list_empty(&adev->pnp.ids)) | 256 | if (list_empty(&adev->pnp.ids)) |
| 256 | return NULL; | 257 | return NULL; |
| 257 | 258 | ||
| 258 | mutex_lock(&adev->physical_node_lock); | 259 | physical_node_lock = &adev->physical_node_lock; |
| 260 | mutex_lock(physical_node_lock); | ||
| 259 | if (list_empty(&adev->physical_node_list)) { | 261 | if (list_empty(&adev->physical_node_list)) { |
| 260 | adev = NULL; | 262 | adev = NULL; |
| 261 | } else { | 263 | } else { |
| @@ -266,7 +268,7 @@ static struct acpi_device *acpi_companion_match(const struct device *dev) | |||
| 266 | if (node->dev != dev) | 268 | if (node->dev != dev) |
| 267 | adev = NULL; | 269 | adev = NULL; |
| 268 | } | 270 | } |
| 269 | mutex_unlock(&adev->physical_node_lock); | 271 | mutex_unlock(physical_node_lock); |
| 270 | 272 | ||
| 271 | return adev; | 273 | return adev; |
| 272 | } | 274 | } |
