Check for num cpus
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Sep 2011 16:31:59 +0000 (12:31 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Sep 2011 16:31:59 +0000 (12:31 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
libringbuffer/ring_buffer_frontend.c

index 5e6d4df267d2c48d9d4c0bfa44b33202574dcea0..0b4b89f7306fee1b77bf4e9b44c9ec48e47af643 100644 (file)
@@ -643,6 +643,8 @@ struct lib_ring_buffer *channel_get_ring_buffer(
                        memory_map_size);
                return shmp(handle, chan->backend.buf[0].shmp);
        } else {
+               if (cpu >= num_possible_cpus())
+                       return NULL;
                ref = &chan->backend.buf[cpu].shmp._ref;
                shm_get_object_data(handle, ref, shm_fd, wait_fd,
                        memory_map_size);
This page took 0.025497 seconds and 4 git commands to generate.