All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  1:23 ` Dexuan Cui
  0 siblings, 0 replies; 8+ messages in thread
From: Dexuan Cui @ 2019-01-30  1:23 UTC (permalink / raw)
  To: Dan Williams, Ross Zwisler, Vishal Verma, Dave Jiang,
	Rafael J. Wysocki, Len Brown, linux-nvdimm, linux-acpi
  Cc: Josh Poulson, Stephen Hemminger, Haiyang Zhang, driverdev-devel,
	linux-kernel, Michael Kelley, Sasha Levin, KY Srinivasan


In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/acpi/nfit/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 0a49c57334cc..1fa378435dd2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -554,6 +554,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -572,13 +579,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
-				dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
 			cmd_name, out_obj->buffer.length);
 	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,
-- 
2.19.1

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

* [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  1:23 ` Dexuan Cui
  0 siblings, 0 replies; 8+ messages in thread
From: Dexuan Cui @ 2019-01-30  1:23 UTC (permalink / raw)
  To: Dan Williams, Ross Zwisler, Vishal Verma, Dave Jiang,
	Rafael J. Wysocki, Len Brown, linux-nvdimm, linux-acpi
  Cc: Josh Poulson, Stephen Hemminger, Haiyang Zhang, driverdev-devel,
	linux-kernel, Michael Kelley, Sasha Levin, KY Srinivasan


In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/acpi/nfit/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 0a49c57334cc..1fa378435dd2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -554,6 +554,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -572,13 +579,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
-				dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
 			cmd_name, out_obj->buffer.length);
 	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,
-- 
2.19.1


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

* [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  1:23 ` Dexuan Cui
  0 siblings, 0 replies; 8+ messages in thread
From: Dexuan Cui @ 2019-01-30  1:23 UTC (permalink / raw)
  To: Dan Williams, Ross Zwisler, Vishal Verma, Dave Jiang,
	Rafael J. Wysocki, Len Brown, linux-nvdimm, linux-acpi
  Cc: Josh Poulson, Stephen Hemminger, Haiyang Zhang, driverdev-devel,
	linux-kernel, Michael Kelley, Sasha Levin


In the case of ND_CMD_CALL, we should also check out_obj->type.

The patch uses out_obj->type, which is a short alias to
out_obj->package.type.

Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
Cc: <stable@vger.kernel.org>
Signed-off-by: Dexuan Cui <decui@microsoft.com>
---
 drivers/acpi/nfit/core.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 0a49c57334cc..1fa378435dd2 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -554,6 +554,13 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return -EINVAL;
 	}
 
+	if (out_obj->type != ACPI_TYPE_BUFFER) {
+		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
+				dimm_name, cmd_name, out_obj->type);
+		rc = -EINVAL;
+		goto out;
+	}
+
 	if (call_pkg) {
 		call_pkg->nd_fw_size = out_obj->buffer.length;
 		memcpy(call_pkg->nd_payload + call_pkg->nd_size_in,
@@ -572,13 +579,6 @@ int acpi_nfit_ctl(struct nvdimm_bus_descriptor *nd_desc, struct nvdimm *nvdimm,
 		return 0;
 	}
 
-	if (out_obj->package.type != ACPI_TYPE_BUFFER) {
-		dev_dbg(dev, "%s unexpected output object type cmd: %s type: %d\n",
-				dimm_name, cmd_name, out_obj->type);
-		rc = -EINVAL;
-		goto out;
-	}
-
 	dev_dbg(dev, "%s cmd: %s output length: %d\n", dimm_name,
 			cmd_name, out_obj->buffer.length);
 	print_hex_dump_debug(cmd_name, DUMP_PREFIX_OFFSET, 4, 4,
-- 
2.19.1

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  6:21   ` Dan Williams
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2019-01-30  6:21 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Josh Poulson, linux-nvdimm, Haiyang Zhang, driverdev-devel,
	Rafael J. Wysocki, linux-kernel, Michael Kelley, Sasha Levin,
	linux-acpi, Ross Zwisler, Stephen Hemminger, KY Srinivasan,
	Len Brown

On Tue, Jan 29, 2019 at 5:23 PM Dexuan Cui <decui@microsoft.com> wrote:
>
>
> In the case of ND_CMD_CALL, we should also check out_obj->type.
>
> The patch uses out_obj->type, which is a short alias to
> out_obj->package.type.
>
> Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>

Looks good to me, applied.
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

* Re: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  6:21   ` Dan Williams
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2019-01-30  6:21 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Josh Poulson, linux-nvdimm-hn68Rpc1hR1g9hUCZPvPmw, Haiyang Zhang,
	driverdev-devel-tBiZLqfeLfOHmIFyCCdPziST3g8Odh+X,
	Rafael J. Wysocki, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	Michael Kelley, Sasha Levin, linux-acpi-u79uwXL29TY76Z2rM5mHXA,
	Ross Zwisler, Stephen Hemminger, KY Srinivasan, Len Brown

On Tue, Jan 29, 2019 at 5:23 PM Dexuan Cui <decui-0li6OtcxBFHby3iVrkZq2A@public.gmane.org> wrote:
>
>
> In the case of ND_CMD_CALL, we should also check out_obj->type.
>
> The patch uses out_obj->type, which is a short alias to
> out_obj->package.type.
>
> Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
> Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
> Signed-off-by: Dexuan Cui <decui-0li6OtcxBFHby3iVrkZq2A@public.gmane.org>

Looks good to me, applied.

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

* Re: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  6:21   ` Dan Williams
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2019-01-30  6:21 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Ross Zwisler, Vishal Verma, Dave Jiang, Rafael J. Wysocki,
	Len Brown, linux-nvdimm, linux-acpi, Josh Poulson,
	Stephen Hemminger, Haiyang Zhang, driverdev-devel, linux-kernel,
	Michael Kelley, Sasha Levin, KY Srinivasan

On Tue, Jan 29, 2019 at 5:23 PM Dexuan Cui <decui@microsoft.com> wrote:
>
>
> In the case of ND_CMD_CALL, we should also check out_obj->type.
>
> The patch uses out_obj->type, which is a short alias to
> out_obj->package.type.
>
> Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>

Looks good to me, applied.

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

* Re: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
@ 2019-01-30  6:21   ` Dan Williams
  0 siblings, 0 replies; 8+ messages in thread
From: Dan Williams @ 2019-01-30  6:21 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: Josh Poulson, Dave Jiang, linux-nvdimm, Vishal Verma,
	Haiyang Zhang, driverdev-devel, Rafael J. Wysocki, linux-kernel,
	Michael Kelley, Sasha Levin, linux-acpi, Ross Zwisler,
	Stephen Hemminger, Len Brown

On Tue, Jan 29, 2019 at 5:23 PM Dexuan Cui <decui@microsoft.com> wrote:
>
>
> In the case of ND_CMD_CALL, we should also check out_obj->type.
>
> The patch uses out_obj->type, which is a short alias to
> out_obj->package.type.
>
> Fixes: 31eca76ba2fc ("nfit, libnvdimm: limited/whitelisted dimm command marshaling mechanism")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Dexuan Cui <decui@microsoft.com>

Looks good to me, applied.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* RE: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
       [not found] ` <20190131020446.9E14D20989@mail.kernel.org>
@ 2019-01-31  6:48   ` Dexuan Cui
  0 siblings, 0 replies; 8+ messages in thread
From: Dexuan Cui @ 2019-01-31  6:48 UTC (permalink / raw)
  To: Sasha Levin, Dan Williams; +Cc: Josh Poulson, stable, stable

> From: Sasha Levin <sashal@kernel.org>
> Sent: Wednesday, January 30, 2019 6:05 PM
> To: Sasha Levin <sashal@kernel.org>; Dexuan Cui <decui@microsoft.com>;
> Dan Williams <dan.j.williams@intel.com>
> Cc: Josh Poulson <jopoulso@microsoft.com>; stable@vger.kernel.org;
> stable@vger.kernel.org
> Subject: Re: [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place
> 
> Hi,
> 
> [This is an automated email]
> 
> This commit has been processed because it contains a "Fixes:" tag,
> fixing commit: 31eca76ba2fc nfit, libnvdimm: limited/whitelisted dimm
> command marshaling mechanism.
> 
> The bot has tested the following trees: v4.20.5, v4.19.18, v4.14.96, v4.9.153.
> 
> v4.20.5: Build OK!
> v4.19.18: Build OK!
> v4.14.96: Failed to apply! Possible dependencies:
>     06e8ccdab15f ("acpi: nfit: Add support for detect platform CPU cache
> flush on power loss")
>     b37b3fd33d03 ("acpi nfit: Enable to show what feature is supported via
> ND_CMD_CALL for nfit_test")
>     b814735f5ca4 ("acpi, nfit: remove redundant __func__ in dev_dbg")
> 
> v4.9.153: Failed to apply! Possible dependencies:
>     010426079ec1 ("sched/headers: Prepare for new header dependencies
> before moving more code to <linux/sched/mm.h>")
>     06e8ccdab15f ("acpi: nfit: Add support for detect platform CPU cache
> flush on power loss")
>     0b277961f448 ("libnvdimm, pmem: disable dax flushing when pmem is
> fronting a volatile region")
>     39bc88e5e38e ("arm64: Disable TTBR0_EL1 during normal kernel
> execution")
>     3f07c0144132 ("sched/headers: Prepare for new header dependencies
> before moving code to <linux/sched/signal.h>")
>     50d34394cee6 ("sched/headers: Prepare to remove the <linux/magic.h>
> include from <linux/sched/task_stack.h>")
>     68db0cf10678 ("sched/headers: Prepare for new header dependencies
> before moving code to <linux/sched/task_stack.h>")
>     7699a6a36b82 ("acpi, nfit: kill ACPI_NFIT_DEBUG")
>     7b6be8444e0f ("dax: refactor dax-fs into a generic provider of 'struct
> dax_device' instances")
>     7c0f6ba682b9 ("Replace <asm/uaccess.h> with <linux/uaccess.h>
> globally")
>     9cf09d68b89a ("arm64: xen: Enable user access before a privcmd hvc
> call")
>     b37b3fd33d03 ("acpi nfit: Enable to show what feature is supported via
> ND_CMD_CALL for nfit_test")
>     b814735f5ca4 ("acpi, nfit: remove redundant __func__ in dev_dbg")
>     bd38967d406f ("arm64: Factor out PAN enabling/disabling into separate
> uaccess_* macros")
>     c1d6e828a35d ("pmem: add dax_operations support")
>     caa603aae0cc ("acpi, nfit: collate health state flags")
> 
> 
> How should we proceed with this patch?
> 
> --
> Thanks,
> Sasha

It's a small pach and I can quickly rebase it to v4.14.96 and v4.9.153 once it goes
into Linus's tree.

Thanks,
-- Dexuan

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

end of thread, other threads:[~2019-01-31  6:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30  1:23 [PATCH] nfit: acpi_nfit_ctl(): check out_obj->type in the right place Dexuan Cui
2019-01-30  1:23 ` Dexuan Cui
2019-01-30  1:23 ` Dexuan Cui
2019-01-30  6:21 ` Dan Williams
2019-01-30  6:21   ` Dan Williams
2019-01-30  6:21   ` Dan Williams
2019-01-30  6:21   ` Dan Williams
     [not found] ` <20190131020446.9E14D20989@mail.kernel.org>
2019-01-31  6:48   ` Dexuan Cui

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.