ACPI / debugger: Fix an issue a flag is modified without locking
authorLv Zheng <lv.zheng@intel.com>
Thu, 24 Dec 2015 06:16:26 +0000 (14:16 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 28 Dec 2015 00:29:40 +0000 (01:29 +0100)
There is one line of code, executed out of locking due to rebase mistakes.
This patch fixes this issue.

Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/acpi/acpi_dbg.c

index 381beb299bf70fd801bae19c024b30a34892dccc..fa18bd0162f4795fb94d5b8fc81ceba4c2b13417 100644 (file)
@@ -516,10 +516,10 @@ static int acpi_aml_open(struct inode *inode, struct file *file)
                        ret = -EINVAL;
                        goto err_lock;
                }
-               acpi_aml_io.flags |= ACPI_AML_OPENED;
                pr_debug("Debugger thread initialized.\n");
 
                mutex_lock(&acpi_aml_io.lock);
+               acpi_aml_io.flags |= ACPI_AML_OPENED;
                acpi_aml_io.out_crc.head = acpi_aml_io.out_crc.tail = 0;
                acpi_aml_io.in_crc.head = acpi_aml_io.in_crc.tail = 0;
                pr_debug("Debugger interface opened.\n");