acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()
Subsystems (2)
PATCH 1/1 acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()
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 second assignment. No functional change.
--- drivers/acpi/nfit/core.c | 1 - 1 file changed, 1 deletion(-)
drivers/acpi/nfit/core.c +0 -1
@@ -2260,7 +2260,6 @@ static int acpi_nfit_init_interleave_set(struct acpi_nfit_desc *acpi_desc, } } - ndr_desc->nd_set = nd_set;devm_kfree (dev, info);devm_kfree (dev, info2);
Signature · 6 lines
2.19.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 5 lines · Wei Yang
We allocate
nd_setinacpi_nfit_init_interleave_set()and assignn it tondr_desc, while the assignment is done twice in this function.This patch removes the second assignment. No functional change.
I think it makes more sense to remove the first assignment. Don't let an uninitialized nd_set escape that routine. Either ->nd_set is left NULL or it points to an initialized instance instead of potentially a zeroed one.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 11 lines · Dan Williams
Quoted 5 lines · Wei Yang
We allocate
nd_setinacpi_nfit_init_interleave_set()and assignn it tondr_desc, while the assignment is done twice in this function.This patch removes the second assignment. No functional change.
I think it makes more sense to remove the first assignment. Don't let an uninitialized
nd_setescape that routine. Either ->nd_set is left NULL or it points to an initialized instance instead of potentially a zeroed one.
Agree, I should be more careful.
Signature · 6 lines
Wei Yang Help you, Help me _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
PATCH v2 1/1 acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()
In reply to Wei YangWe 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.
---
v2:
* remove the first assignment to avoid some leak
--- drivers/acpi/nfit/core.c | 1 - 1 file changed, 1 deletion(-)
drivers/acpi/nfit/core.c +0 -1
@@ -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 );
Signature · 6 lines
2.19.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm
Quoted 11 lines · Wei Yang
We allocate
nd_setinacpi_nfit_init_interleave_set()and assignn it tondr_desc, while the assignment is done twice in this function.This patch removes the first assignment. No functional change.
Signed-off-by Wei Yang <[email protected]>---
v2:
* remove the first assignment to avoid some leak
Looks good, applied.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm