From: Mathieu Desnoyers Date: Wed, 25 May 2011 18:57:01 +0000 (-0400) Subject: Return error if subbuffer size is lower than a page X-Git-Tag: v2.0-pre1~89 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2fb46300208fedb9d1a6e93de359674d2a02a5a7;p=lttng-modules.git Return error if subbuffer size is lower than a page ... gentler than a warning and a crash. Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index 2ddb9f99..332a1d23 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -311,7 +311,8 @@ int channel_backend_init(struct channel_backend *chanb, return -EPERM; /* Check that the subbuffer size is larger than a page. */ - CHAN_WARN_ON(chanb, subbuf_size < PAGE_SIZE); + if (subbuf_size < PAGE_SIZE) + return -EINVAL; /* * Make sure the number of subbuffers and subbuffer size are power of 2.