Skip to contentSkip to conversation

ndctl: remove a double put in injection status json

PATCH In review Vishal Verma 2 participants 2 messages Feb 1, 2018 libnvdimm: non-volatile memory device

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 ndctl: remove a double put in injection status json

newer json-c catches a double put of the json object in printing the injection status. We only need to put the containing jobj.

---
 ndctl/inject-error.c | 2 --
 1 file changed, 2 deletions(-)
ndctl/inject-error.c +0 -2
index 374ae0b..9b9d821 100644
@@ -263,8 +263,6 @@ static int injection_status(struct ndctl_namespace *ndns)
 		printf("%s\n", json_object_to_json_string_ext(jobj,
 			JSON_C_TO_STRING_PRETTY));
 	}
-
-	json_object_put(jbbs);
 	json_object_put(jobj);
 
 	return rc;
Signature · 6 lines
2.14.3

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
Reviewed-by on v1 1/1
#1 lore raw
Quoted 14 lines · Vishal Verma

newer json-c catches a double put of the json object in printing the injection status. We only need to put the containing jobj.

---
 ndctl/inject-error.c | 2 --
 1 file changed, 2 deletions(-)
ndctl/inject-error.c +0 -0
index 374ae0b..9b9d821 100644

ndctl/inject-error.c static int injection_status(struct ndctl_namespace *ndns) · line 266

Quoted 6 lines
ndctl/inject-error.c +0 -2
@@ -263,8 +263,6 @@ static int injection_status(struct ndctl_namespace *ndns)
                printf("%s\n", json_object_to_json_string_ext(jobj,
                        JSON_C_TO_STRING_PRETTY));
        }
-
-       json_object_put(jbbs);
        json_object_put(jobj);

Yeah, once you link an object to a container you only need to put that parent object. Looks good to me.

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm