Fix uninitialized return variable in error path for contexts
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:16:35 +0000 (22:16 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 24 Jun 2011 02:16:35 +0000 (22:16 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lttng-context-comm.c
lttng-context-nice.c
lttng-context-pid.c
lttng-context-ppid.c
lttng-context-prio.c
lttng-context-tid.c
lttng-context-vpid.c
lttng-context-vppid.c
lttng-context-vtid.c

index 6e51bf854a3bad17765085d493c7536d94686b81..ede3f51a0d4bd9ffd9568d75a28e1fc4ebc75668 100644 (file)
@@ -41,11 +41,10 @@ void comm_record(struct lttng_ctx_field *field,
 int lttng_add_comm_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "comm";
        field->event_field.type.atype = atype_array;
        field->event_field.type.u.array.elem_type.atype = atype_integer;
index d7fafb9d3939af55615effcd8a44e0b4fe5cab67..bfe688ef1084c1b1c8a327f383ef01dbf1281240 100644 (file)
@@ -40,11 +40,10 @@ void nice_record(struct lttng_ctx_field *field,
 int lttng_add_nice_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "nice";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(int) * CHAR_BIT;
index 5400db9632ab1f7f5ef332e88df78f219fce3c5f..ee2c4f0f5c36ebb116cfa66a8ec46658cc217920 100644 (file)
@@ -40,11 +40,10 @@ void pid_record(struct lttng_ctx_field *field,
 int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "pid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
index 342aa343337b2a55a380da763651a9e22225cf96..9f647ab1a079eac1066057cebefea2205a7b8ee7 100644 (file)
@@ -43,11 +43,10 @@ void ppid_record(struct lttng_ctx_field *field,
 int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "ppid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
index d159e02d4dbf270bcd3059e31d6fc41e88120b31..842717ca7c74def7f4368aae807083c5b2b34666 100644 (file)
@@ -63,7 +63,7 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "prio";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(int) * CHAR_BIT;
index 4e974f8d8e78c35b0fea2d93e98ed00152f4c0cd..f207d986af5bbf15f979d27c254701d35b5c7e8b 100644 (file)
@@ -40,11 +40,10 @@ void tid_record(struct lttng_ctx_field *field,
 int lttng_add_tid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "tid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
index 3bbb87f413f25512b5b393eebaeb8110c16e1485..c99010cf80a60ba71e7a937547cabe1059f661c1 100644 (file)
@@ -40,11 +40,10 @@ void vpid_record(struct lttng_ctx_field *field,
 int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "vpid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
index 813ccc61115d31a26463ead8ce647d949e2e9d6b..d55e12db6b2541afd1d7da7274fdb6385f326088 100644 (file)
@@ -43,11 +43,10 @@ void vppid_record(struct lttng_ctx_field *field,
 int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx)
 {
        struct lttng_ctx_field *field;
-       int ret;
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "vppid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
index 665e1a9c21755bb8b4a4aab4f07e6dcdf4ce00b1..f81fff636acd35d914a2756c567e68d03d562c24 100644 (file)
@@ -44,7 +44,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
 
        field = lttng_append_context(ctx);
        if (!field)
-               return ret;
+               return -ENOMEM;
        field->event_field.name = "vtid";
        field->event_field.type.atype = atype_integer;
        field->event_field.type.u.basic.integer.size = sizeof(pid_t) * CHAR_BIT;
This page took 0.034928 seconds and 4 git commands to generate.