All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Robert Richter <robert.richter@amd.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	oprofile-list <oprofile-list@lists.sourceforge.net>
Subject: Re: [PATCH v2] oprofile: Fix uninitialized memory access when writing to
Date: Mon, 19 Dec 2011 17:19:32 +0100	[thread overview]
Message-ID: <20111219161932.GA10017@elte.hu> (raw)
In-Reply-To: <20111219153830.GH16765@erda.amd.com>


* Robert Richter <robert.richter@amd.com> wrote:

> On 19.12.11 15:17:03, Robert Richter wrote:
> > On 19.12.11 15:00:49, Ingo Molnar wrote:
> > 
> > > +	if (!count)
> > > +		return 0;
> > > +
> > >  	retval = oprofilefs_ulong_from_user(&value, buf, count);
> > >  	if (retval)
> > >  		return retval;
> > > 
> > > See the ugly and fragile pattern?
> > > 
> > > This should *really* be solved via the 
> > > oprofilefs_ulong_from_user() helper function, not by sprinkling 
> > > the !count checks in half a dozen places ...
> > 
> > Hmm, I thought there was no way to leave the code path with count == 0
> > and retval. But thinking about it it would be possible with returning
> > count or errors < 0. Will improve the patch.
> 
> Ingo, see my updated version below. [...]

Yeah, this looks a lot cleaner.

> [...] I am fine with appling it directly on tip/perf/urgent.

Applied,

Thanks,

	Ingo

  reply	other threads:[~2011-12-19 16:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-19 13:46 [GIT PULL] oprofile fixes for 3.2 Robert Richter
2011-12-19 13:46 ` [PATCH] oprofile: Fix uninitialized memory access when writing to oprofilefs Robert Richter
2011-12-19 14:00 ` [GIT PULL] oprofile fixes for 3.2 Ingo Molnar
2011-12-19 14:17   ` Robert Richter
2011-12-19 15:38     ` [PATCH v2] oprofile: Fix uninitialized memory access when writing to Robert Richter
2011-12-19 16:19       ` Ingo Molnar [this message]
2011-12-20  8:57       ` [tip:perf/urgent] oprofile: Fix uninitialized memory access when writing to writing to oprofilefs tip-bot for Robert Richter
2011-12-22 15:15 ` [PATCH] oprofile, arm/sh: Fix oprofile_arch_exit() linkage issue Robert Richter
2011-12-23 13:19   ` [tip:perf/urgent] " tip-bot for Vladimir Zapolskiy

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=20111219161932.GA10017@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oprofile-list@lists.sourceforge.net \
    --cc=robert.richter@amd.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.