Fix possible NULL pointer dereference
authorDavid Goulet <david.goulet@polymtl.ca>
Tue, 8 Nov 2011 19:30:20 +0000 (14:30 -0500)
committerDavid Goulet <david.goulet@polymtl.ca>
Tue, 8 Nov 2011 19:30:20 +0000 (14:30 -0500)
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
lttng-sessiond/ust-app.c

index b2c73ffed08894a3af0622d226491e060e5110fb..72e3aeef2c68aee6d71b67f1a0c28393e8387e5c 100644 (file)
@@ -859,10 +859,16 @@ void ust_app_global_update(struct ltt_ust_session *usess, int sock)
        struct lttng_ust_object_data *obj_event;
        struct lttng_ust_channel_attr uattr;
 
+       rcu_read_lock();
+
+       if (usess == NULL) {
+               DBG2("No UST session on global update. Returning");
+               goto error;
+       }
+
        DBG2("UST app global update for app sock %d for session uid %d", sock,
                        usess->uid);
 
-       rcu_read_lock();
        app = find_app_by_sock(sock);
        if (app == NULL) {
                ERR("Failed to update app sock %d", sock);
This page took 0.026866 seconds and 4 git commands to generate.