lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH 3/3] kernel-shark: fix unitialized handle compile warnings
    From
    Date
    On Wed, 2010-02-03 at 11:17 -0500, Steven Rostedt wrote:
    > andle)
    > > > - handle = tracecmd_open(input_file);
    > > > + handle = tracecmd_open(input_file);
    > > >
    > > > - info->handle = handle;
    > > > + if (handle)
    > > > + info->handle = handle;
    > > >
    > > > /* --- Main window --- */
    > > >
    > > > --
    > >
    > > This looks correct, but I'm wondering if it is safe to continue if the
    > > call to tracecmd_open fails?
    >
    > Actually this patch is wrong. The real code should be:
    >
    > - if (handle)
    > + if (input_file)

    Looking at the context, this isn't enough. We should have had:

    if (input_file)
    info->handle = tracecmd_open(input_file);
    else
    info->handle = NULL;

    -- Steve




    \
     
     \ /
      Last update: 2010-02-03 17:21    [W:0.050 / U:33.988 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site