|
@@ -657,8 +657,8 @@ struct ring_buffer *__ring_buffer_alloc(unsigned long size, unsigned flags,
|
|
buffer->reader_lock_key = key;
|
|
buffer->reader_lock_key = key;
|
|
|
|
|
|
/* need at least two pages */
|
|
/* need at least two pages */
|
|
- if (buffer->pages == 1)
|
|
|
|
- buffer->pages++;
|
|
|
|
|
|
+ if (buffer->pages < 2)
|
|
|
|
+ buffer->pages = 2;
|
|
|
|
|
|
/*
|
|
/*
|
|
* In case of non-hotplug cpu, if the ring-buffer is allocated
|
|
* In case of non-hotplug cpu, if the ring-buffer is allocated
|