lkml.org 
[lkml]   [2013]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH V3] perf tools: Change the default filenames for perf kvm diff to perf.data.xxx and perf.data.xxx.old
On 12/11/13, 9:30 AM, Dongsheng Yang wrote:
> @@ -1001,8 +1002,28 @@ static int data_init(int argc, const char **argv)
> use_default = false;
> }
> } else if (perf_guest) {
> - defaults[0] = "perf.data.host";
> - defaults[1] = "perf.data.guest";
> + char *file_name;
> + int len, ret;
> +
> + file_name = (char *)get_filename_for_perf_kvm();
> + if (!file_name) {
> + pr_err("Failed to allocate memory for filename\n");
> + return -ENOMEM;
> + }
> +

The need for a typecast should tell you something is wrong. Why is
get_filename_for_perf_kvm returning a const char * when it is allocated
memory?

David


\
 
 \ /
  Last update: 2013-12-11 05:01    [W:0.152 / U:0.288 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site