From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] lttng lib: ring buffer
Date: Wed, 30 Nov 2011 08:16:19 -0500 [thread overview]
Message-ID: <20111130131619.GA24843@Krystal> (raw)
In-Reply-To: <20111130084527.GF6268@elgon.mountain>
Fixed by moving the check higher up, to lib_ring_buffer_open.
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 +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
>
> regards,
> dan carpenter
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
next prev parent reply other threads:[~2011-11-30 13:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 8:45 Dan Carpenter
2011-11-30 13:16 ` Mathieu Desnoyers [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-11-30 8:44 Dan Carpenter
2011-11-30 13:07 ` Mathieu Desnoyers
2011-11-30 8:44 Dan Carpenter
2011-11-30 13:03 ` Mathieu Desnoyers
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111130131619.GA24843@Krystal \
--to=mathieu.desnoyers@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox