From 915d047cc8abd8a6e1255dba3e877236f8e8be51 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Tue, 14 Feb 2012 15:40:17 -0500 Subject: [PATCH] Fix return value on ust app session create Two possible error can occur here where the malloc() failed or the tracer is gone (app unregistered) so two error code is needed. Signed-off-by: David Goulet --- src/bin/lttng-sessiond/ust-app.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 2b66b92c0..bb012b5d8 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -865,6 +865,8 @@ static struct ust_app_session *create_ust_app_session( ret = ustctl_create_session(app->key.sock); if (ret < 0) { ERR("Creating session for app pid %d", app->key.pid); + /* This means that the tracer is gone... */ + ua_sess = (void*) -1UL; goto error; } @@ -1757,8 +1759,11 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess, */ ua_sess = create_ust_app_session(usess, app); if (ua_sess == NULL) { - /* Major problem here and it's maybe the tracer or malloc() */ + /* The malloc() failed. */ goto error; + } else if (ua_sess == (void *) -1UL) { + /* The application's socket is not valid. Contiuing */ + continue; } /* Create channel onto application */ -- 2.34.1