]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
acpi, nfit: check for the correct event code in notifications
authorVishal Verma <vishal.l.verma@intel.com>
Fri, 19 Aug 2016 20:40:58 +0000 (14:40 -0600)
committerDan Williams <dan.j.williams@intel.com>
Tue, 23 Aug 2016 14:49:08 +0000 (07:49 -0700)
Commit 209851649dc4 "acpi: nfit: Add support for hot-add" added
support for _FIT notifications, but it neglected to verify the
notification event code matches the one in the ACPI spec for
"NFIT Update". Currently there is only one code in the spec, but
once additional codes are added, older kernels (without this fix)
will misbehave by assuming all event notifications are for an
NFIT Update.

Fixes: 209851649dc4 ("acpi: nfit: Add support for hot-add")
Cc: <stable@vger.kernel.org>
Cc: <linux-acpi@vger.kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Reported-by: Linda Knippers <linda.knippers@hpe.com>
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/acpi/nfit/core.c
drivers/acpi/nfit/nfit.h

index 80cc7c089a15e908ae070d95ad4879e5b6309555..4a363bed89b3a39cb198e15ab9decd080d5792fa 100644 (file)
@@ -2681,6 +2681,9 @@ static void acpi_nfit_notify(struct acpi_device *adev, u32 event)
 
        dev_dbg(dev, "%s: event: %d\n", __func__, event);
 
+       if (event != NFIT_NOTIFY_UPDATE)
+               return;
+
        device_lock(dev);
        if (!dev->driver) {
                /* dev->driver may be null if we're being removed */
index e894ded24d99399483dc593e24cdd277d8393db3..51d23f130d863dd8fcd9f807dbbd43a15fb3ebcc 100644 (file)
@@ -78,6 +78,10 @@ enum {
        NFIT_ARS_TIMEOUT = 90,
 };
 
+enum nfit_root_notifiers {
+       NFIT_NOTIFY_UPDATE = 0x80,
+};
+
 struct nfit_spa {
        struct list_head list;
        struct nd_region *nd_region;