[lttng-dev] lttng lib: ring buffer

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Wed Nov 30 08:07:57 EST 2011


Will remove the duplicated check (it's already checked within
lib_ring_buffer_mmap_buf), and push to gregkh in my next round, thanks!

Mathieu

* Dan Carpenter (dan.carpenter at oracle.com) wrote:
> Hello Mathieu Desnoyers,
> 
> This is a semi-automatic email about new static checker warnings.
> 
> The patch c844b2f5cfea: "lttng lib: ring buffer" from Nov 28, 2011, 
> leads to the following Smatch complaint:
> 
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c +33 lib_ring_buffer_fault()
> 	 warn: variable dereferenced before check 'buf' (see line 26)
> 
> drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c
>     25		struct lib_ring_buffer *buf = vma->vm_private_data;
>     26		struct channel *chan = buf->backend.chan;
>                                        ^^^^^^^^^^^^^^^^^
> Dereference.
> 
>     27		const struct lib_ring_buffer_config *config = chan->backend.config;
>     28		pgoff_t pgoff = vmf->pgoff;
>     29		struct page **page;
>     30		void **virt;
>     31		unsigned long offset, sb_bindex;
>     32	
>     33		if (!buf)
>                     ^^^^
> Check.
> 
>     34			return VM_FAULT_OOM;
>     35	
> 
> regards,
> dan carpenter
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list