projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: remove one too many metadata refcount increment
[lttng-tools.git]
/
src
/
common
/
consumer.c
diff --git
a/src/common/consumer.c
b/src/common/consumer.c
index b5fe9831640217455c40c11b9e85e36b470ec05c..3709092198e5a9d1fcf6781134ba7e645ce3e202 100644
(file)
--- a/
src/common/consumer.c
+++ b/
src/common/consumer.c
@@
-1960,6
+1960,13
@@
void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
}
end:
}
end:
+ /*
+ * Nullify the stream reference so it is not used after deletion. The
+ * consumer data lock MUST be acquired before being able to check for a
+ * NULL pointer value.
+ */
+ stream->chan->metadata_stream = NULL;
+
pthread_mutex_unlock(&stream->lock);
pthread_mutex_unlock(&consumer_data.lock);
pthread_mutex_unlock(&stream->lock);
pthread_mutex_unlock(&consumer_data.lock);
@@
-2012,9
+2019,6
@@
static int add_metadata_stream(struct lttng_consumer_stream *stream,
uatomic_inc(&relayd->refcount);
}
uatomic_inc(&relayd->refcount);
}
- /* Update channel refcount once added without error(s). */
- uatomic_inc(&stream->chan->refcount);
-
/*
* When nb_init_stream_left reaches 0, we don't need to trigger any action
* in terms of destroying the associated channel, because the action that
/*
* When nb_init_stream_left reaches 0, we don't need to trigger any action
* in terms of destroying the associated channel, because the action that
@@
-2969,7
+2973,7
@@
end:
}
}
if (client_socket >= 0) {
}
}
if (client_socket >= 0) {
- ret = close(
sock
);
+ ret = close(
client_socket
);
if (ret < 0) {
PERROR("close client_socket sessiond poll");
}
if (ret < 0) {
PERROR("close client_socket sessiond poll");
}
This page took
0.030532 seconds
and
4
git commands to generate.