aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorMathieu Desnoyers <[email protected]>2011-11-30 13:34:16 -0500
committerGreg Kroah-Hartman <[email protected]>2011-12-01 09:37:48 -0800
commiteeb34e2113576aea782094d1e30f22b445355fe8 (patch)
treef9c9955250154f447fb0b094ffa28b109bfb5c42 /tools/perf/scripts/python
parente5f7787388da7562b955a36b46e909e500a5974b (diff)
lttng lib: ring buffer move null pointer check to open
* Dan Carpenter <[email protected]> wrote: > 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 +86 > +lib_ring_buffer_mmap_buf() > warn: variable dereferenced before check 'buf' (see line 79) > > drivers/staging/lttng/lib/ringbuffer/ring_buffer_mmap.c > 78 unsigned long length = vma->vm_end - vma->vm_start; > 79 struct channel *chan = buf->backend.chan; > ^^^^^^^^^^^^^^^^^ > Dereference. > > 80 const struct lib_ring_buffer_config *config = chan->backend.config; > 81 unsigned long mmap_buf_len; > 82 > 83 if (config->output != RING_BUFFER_MMAP) > 84 return -EINVAL; > 85 > 86 if (!buf) > ^^^^ > Check. > > 87 return -EBADF; > 88 Let's move the NULL buf check to the file "open", where it belongs. The "open" file operation is the actual interface between lib ring buffer and the modules using it. Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Mathieu Desnoyers <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions