From: Steven Rostedt <rostedt@goodmis.org>
To: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com>
Cc: linux-trace-devel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] libtraceevent: Add dynamic_offset()
Date: Wed, 4 Aug 2021 11:58:10 -0400 [thread overview]
Message-ID: <20210804115810.11569725@oasis.local.home> (raw)
In-Reply-To: <20210804125526.19774-1-y.karadz@gmail.com>
On Wed, 4 Aug 2021 15:55:25 +0300
"Yordan Karadzhov (VMware)" <y.karadz@gmail.com> wrote:
> + if (*offset)
> + *offset = (unsigned int)(val & TEP_OFFSET_LEN_MASK);
> + if (*len)
> + *len = (unsigned int)((val >> TEP_LEN_SHIFT) & TEP_OFFSET_LEN_MASK);
> +}
Oops, the above is wrong. It should be:
if (offset)
*offset = (unsigned int)(val & TEP_OFFSET_LEN_MASK);
if (len)
*len = (unsigned int)((val >> TEP_LEN_SHIFT) & TEP_OFFSET_LEN_MASK);
And yes, this would crash if NULL is passed in.
-- Steve
prev parent reply other threads:[~2021-08-04 15:58 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-04 12:55 [PATCH v2 1/2] libtraceevent: Add dynamic_offset() Yordan Karadzhov (VMware)
2021-08-04 12:55 ` [PATCH v2 2/2] libtraceevent: Keep the pointer to the field in args (WiP) Yordan Karadzhov (VMware)
2021-08-04 16:04 ` Steven Rostedt
2021-08-04 15:58 ` Steven Rostedt [this message]
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=20210804115810.11569725@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=linux-trace-devel@vger.kernel.org \
--cc=y.karadz@gmail.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;
as well as URLs for NNTP newsgroup(s).