diff mbox series

[v2] acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()

Message ID 20190115030946.4991-1-richardw.yang@linux.intel.com (mailing list archive)
State Mainlined
Commit b4fe30e45a660efa8f122070fc7173715d0e1d00
Headers show
Series [v2] acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set() | expand

Commit Message

Wei Yang Jan. 15, 2019, 3:09 a.m. UTC
We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to
ndr_desc, while the assignment is done twice in this function.

This patch removes the first assignment. No functional change.

Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>

---
v2:
   * remove the first assignment to avoid some leak
---
 drivers/acpi/nfit/core.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Dan Williams Jan. 15, 2019, 3:13 a.m. UTC | #1
On Mon, Jan 14, 2019 at 7:10 PM Wei Yang <richardw.yang@linux.intel.com> wrote:
>
> We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to
> ndr_desc, while the assignment is done twice in this function.
>
> This patch removes the first assignment. No functional change.
>
> Signed-off-by: Wei Yang <richardw.yang@linux.intel.com>
>
> ---
> v2:
>    * remove the first assignment to avoid some leak

Looks good, applied.
diff mbox series

Patch

diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
index 5912d30020c7..9c3c2d2f37be 100644
--- a/drivers/acpi/nfit/core.c
+++ b/drivers/acpi/nfit/core.c
@@ -2187,7 +2187,6 @@  static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc,
 	nd_set = devm_kzalloc(dev, sizeof(*nd_set), GFP_KERNEL);
 	if (!nd_set)
 		return -ENOMEM;
-	ndr_desc->nd_set = nd_set;
 	guid_copy(&nd_set->type_guid, (guid_t *) spa->range_guid);
 
 	info = devm_kzalloc(dev, sizeof_nfit_set_info(nr), GFP_KERNEL);