lkml.org 
[lkml]   [2011]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] oprofile: Fix uninitialized memory access when writing to

* 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


\
 
 \ /
  Last update: 2011-12-19 17:23    [from the cache]
©2003-2011 Jasper Spaans