lkml.org 
[lkml]   [2010]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] kernel-shark: fix unitialized handle compile warnings
From
On Mon, Feb 1, 2010 at 5:50 PM, Darren Hart <dvhltc@us.ibm.com> wrote:
> Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
> ---
>  kernel-shark.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel-shark.c b/kernel-shark.c
> index 9dedf48..222381c 100644
> --- a/kernel-shark.c
> +++ b/kernel-shark.c
> @@ -596,10 +596,10 @@ void kernel_shark(int argc, char **argv)
>                if (ret >= 0)
>                        input_file = default_input_file;
>        }
> -       if (handle)
> -               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?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2010-02-03 17:09    [from the cache]
©2003-2011 Jasper Spaans