- ua_sess = create_ust_app_session(usess, app);
- if (ua_sess == NULL) {
- /* The malloc() failed. */
- ret = -ENOMEM;
- goto error_rcu_unlock;
- } else if (ua_sess == (void *) -1UL) {
- /*
- * The application's socket is not valid. Either a bad socket or a
- * timeout on it. We can't inform yet the caller that for a
- * specific app, the session failed so we continue here.
- */
- continue;
+ ret = create_ust_app_session(usess, app, &ua_sess, &created);
+ if (ret < 0) {
+ switch (ret) {
+ case -ENOTCONN:
+ /*
+ * The application's socket is not valid. Either a bad socket
+ * or a timeout on it. We can't inform the caller that for a
+ * specific app, the session failed so lets continue here.
+ */
+ continue;
+ case -ENOMEM:
+ default:
+ goto error_rcu_unlock;
+ }