Re: [PATCH 23/74] perf kvm: Initialize file_name var to fix segfault

From: Xiao Guangrong
Date: Thu Jan 24 2013 - 22:00:47 EST


On 01/25/2013 04:07 AM, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
>
> The 3786063 commit:
>
> perf kvm: Rename perf_kvm to perf_kvm_stat
>
> Moved the file_name from inside a local struct var that initialized some
> of its members, thus zero initializing the not explicitely initialized
> variables, one of which was 'file_name', to a standalone local variable,
> but forgot to initialize it explicitely to NULL, so it then got some
> undefined value, causing a segfault in strdup when it wasn't, by luck,
> zero.
>
> Fix it by explicitely initializing it to NULL.

Thank you for fixing my fault.

Reviewed-by: Xiao Guangrong <xiaoguangrong@xxxxxxxxxxxxxxxxxx>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/