Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 74688ce4 authored by Vishal Verma's avatar Vishal Verma Committed by Greg Kroah-Hartman
Browse files

acpi, nfit: check for the correct event code in notifications



commit c09f12186d6b03b798832d95289af76495990192 upstream.

Commit 20985164 "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: 20985164 ("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: default avatarLinda Knippers <linda.knippers@hpe.com>
Signed-off-by: default avatarVishal Verma <vishal.l.verma@intel.com>
Signed-off-by: default avatarDan Williams <dan.j.williams@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 70c66946
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1806,6 +1806,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 */
+4 −0
Original line number Diff line number Diff line
@@ -45,6 +45,10 @@ enum {
	ND_BLK_DCR_LATCH = 2,
};

enum nfit_root_notifiers {
	NFIT_NOTIFY_UPDATE = 0x80,
};

struct nfit_spa {
	struct acpi_nfit_system_address *spa;
	struct list_head list;