linux-trace-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Slavomir Kaslev <kaslevs@vmware.com>
Cc: "linux-trace-devel@vger.kernel.org"  <linux-trace-devel@vger.kernel.org>
Subject: Re: [PATCH] trace-cmd: Have tracecmd_msg_data_send() return zero on zero size
Date: Fri, 22 Mar 2019 08:17:44 -0400	[thread overview]
Message-ID: <20190322081744.5df7cf3a@gandalf.local.home> (raw)
In-Reply-To: <66ec4786aecc3585081b932ab96b700f13f78d96.camel@vmware.com>

On Fri, 22 Mar 2019 11:49:29 +0000
Slavomir Kaslev <kaslevs@vmware.com> wrote:

> > diff --git a/tracecmd/trace-msg.c b/tracecmd/trace-msg.c
> > index 51d0ac8b..382bd766 100644
> > --- a/tracecmd/trace-msg.c
> > +++ b/tracecmd/trace-msg.c
> > @@ -590,6 +590,10 @@ int tracecmd_msg_data_send(struct
> > tracecmd_msg_handle *msg_handle,
> >  	int ret;
> >  	int count = 0;
> >  
> > +	/* Don't bother doing anything if there's nothing to do */
> > +	if (!size)
> > +		return 0;
> > +
> >  	tracecmd_msg_init(MSG_SEND_DATA, &msg);
> >  
> >  	msg.buf = malloc(MSG_MAX_DATA_LEN);  
> 
> Nice catch. Definitely a latent bug waiting for someone to step on it.
> 
> Reviewed-by: Slavomir Kaslev <kaslevs@vmware.com>

Yeah, it tripped me up, as I had a box that crashed because of it.
Delaying the finishing of the testing. Which I'm rerunning now.

-- Steve

      reply	other threads:[~2019-03-22 12:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-21 23:41 [PATCH] trace-cmd: Have tracecmd_msg_data_send() return zero on zero size Steven Rostedt
2019-03-22 11:49 ` Slavomir Kaslev
2019-03-22 12:17   ` 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=20190322081744.5df7cf3a@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=kaslevs@vmware.com \
    --cc=linux-trace-devel@vger.kernel.org \
    /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).