All of lore.kernel.org
 help / color / mirror / Atom feed
* [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications
@ 2016-10-24 21:58 ` Vishal Verma
  0 siblings, 0 replies; 4+ messages in thread
From: Vishal Verma @ 2016-10-24 21:58 UTC (permalink / raw)
  To: stable; +Cc: Greg Kroah-Hartman, linux-nvdimm

commit c09f12186d6b03b798832d95289af76495990192 upstream.

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")
Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
---

Note that the patch doesn't directly apply to stable-4.4, but using
'git am -3' works. Is this sufficient, or should I send a sepatate
patch for 4.4?

 drivers/acpi/nfit.c | 3 +++
 drivers/acpi/nfit.h | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/acpi/nfit.c b/drivers/acpi/nfit.c
index 375c10f..a071fe4 100644
--- a/drivers/acpi/nfit.c
+++ b/drivers/acpi/nfit.c
@@ -2605,6 +2605,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 */
diff --git a/drivers/acpi/nfit.h b/drivers/acpi/nfit.h
index 02b9ea1..e602fd2 100644
--- a/drivers/acpi/nfit.h
+++ b/drivers/acpi/nfit.h
@@ -73,6 +73,10 @@ enum {
 	NFIT_ARS_TIMEOUT = 90,
 };
 
+enum nfit_root_notifiers {
+	NFIT_NOTIFY_UPDATE = 0x80,
+};
+
 struct nfit_spa {
 	struct acpi_nfit_system_address *spa;
 	struct list_head list;
-- 
2.7.4

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-10-26  9:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 21:58 [4.4, 4.7 stable PATCH] acpi, nfit: check for the correct event code in notifications Vishal Verma
2016-10-24 21:58 ` Vishal Verma
2016-10-26  9:23 ` Greg Kroah-Hartman
2016-10-26  9:23   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.