On channel error, RCU was not unlocking the read side. Furthermore,
remove a check for a NULL session that was also not going through an RCU
unlock. Change it to an assert.
This also adds a channel subbuf size check when enabling a channel.
Signed-off-by: David Goulet <dgoulet@efficios.com>
attr = defattr;
}
+ if (attr->attr.subbuf_size < DEFAULT_UST_CHANNEL_SUBBUF_SIZE) {
+ ret = LTTNG_ERR_INVALID;
+ goto error;
+ }
+
/*
* Validate UST buffer size and number of buffers: must both be
* power of 2 and nonzero. We validate right here for UST,
if (ua_sess == NULL) {
/* The malloc() failed. */
ret = -1;
- goto error;
+ goto error_rcu_unlock;
} else if (ua_sess == (void *) -1UL) {
/* The application's socket is not valid. Contiuing */
ret = -1;
if (ua_chan == NULL) {
/* Major problem here and it's maybe the tracer or malloc() */
ret = -1;
- goto error;
+ goto error_rcu_unlock;
}
}
+error_rcu_unlock:
rcu_read_unlock();
-
-error:
return ret;
}
struct ust_app_event *ua_event;
struct ust_app_ctx *ua_ctx;
- if (usess == NULL) {
- ERR("No UST session on global update. Returning");
- goto error;
- }
+ assert(usess);
DBG2("UST app global update for app sock %d for session id %d", sock,
usess->id);