Return error if subbuffer size is lower than a page
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 25 May 2011 18:57:01 +0000 (14:57 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 25 May 2011 18:57:01 +0000 (14:57 -0400)
... gentler than a warning and a crash.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
lib/ringbuffer/ring_buffer_backend.c

index 2ddb9f991bc9cc763e9008c8237683ba38edb542..332a1d23ae46fef3484670d9b4c8c7e6ad252b31 100644 (file)
@@ -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.
This page took 0.027053 seconds and 4 git commands to generate.