projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: sessiond: Dereference before null check
[lttng-tools.git]
/
src
/
bin
/
lttng-sessiond
/
manage-kernel.c
diff --git
a/src/bin/lttng-sessiond/manage-kernel.c
b/src/bin/lttng-sessiond/manage-kernel.c
index 35547743c295e1cdb7c7f71e2f2114813a22761d..f656c9f5cc6fcdc1e4b16219d22a7c76c9a70592 100644
(file)
--- a/
src/bin/lttng-sessiond/manage-kernel.c
+++ b/
src/bin/lttng-sessiond/manage-kernel.c
@@
-70,6
+70,7
@@
static int update_kernel_poll(struct lttng_poll_event *events)
DBG("Channel fd %d added to kernel set", channel->fd);
}
session_unlock(session);
DBG("Channel fd %d added to kernel set", channel->fd);
}
session_unlock(session);
+ session_put(session);
}
session_unlock_list();
}
session_unlock_list();
@@
-266,11
+267,6
@@
static void *thread_kernel_management(void *data)
health_code_update();
health_code_update();
- if (!revents) {
- /* No activity for this FD (poll implementation). */
- continue;
- }
-
if (pollfd == quit_pipe_read_fd) {
err = 0;
goto exit;
if (pollfd == quit_pipe_read_fd) {
err = 0;
goto exit;
@@
-346,13
+342,12
@@
bool launch_kernel_management_thread(int kernel_poll_pipe_read_fd)
struct thread_notifiers *notifiers = NULL;
struct lttng_thread *thread;
struct thread_notifiers *notifiers = NULL;
struct lttng_thread *thread;
- quit_pipe = lttng_pipe_open(FD_CLOEXEC);
- if (!quit_pipe) {
- goto error;
- }
-
notifiers = zmalloc(sizeof(*notifiers));
if (!notifiers) {
notifiers = zmalloc(sizeof(*notifiers));
if (!notifiers) {
+ goto error_alloc;
+ }
+ quit_pipe = lttng_pipe_open(FD_CLOEXEC);
+ if (!quit_pipe) {
goto error;
}
notifiers->quit_pipe = quit_pipe;
goto error;
}
notifiers->quit_pipe = quit_pipe;
@@
-370,5
+365,6
@@
bool launch_kernel_management_thread(int kernel_poll_pipe_read_fd)
return true;
error:
cleanup_kernel_management_thread(notifiers);
return true;
error:
cleanup_kernel_management_thread(notifiers);
+error_alloc:
return false;
}
return false;
}
This page took
0.029547 seconds
and
5
git commands to generate.