lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 Dec 2013 11:46:31 -0500
From:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
To:	David Ahern <dsahern@...il.com>
CC:	acme@...stprotocols.net, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3] perf tools: Change the default filenames for perf
 kvm diff to perf.data.xxx and perf.data.xxx.old

On 12/10/2013 10:38 PM, David Ahern wrote:
> 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?
>

Yes, there is something is wrong I think. It returning const char* 
because I assume the file_name will never be changed. But now, this 
assumption seems outdated.

I will add a new patch to change the return value to char *, as the 
other two patches is already applied.
http://git.kernel.org/cgit/linux/kernel/git/acme/linux.git/commit/?h=perf/core&id=e1a2b174dbbe08dce12bde9f05f64dbbae652bed

Thanx

Yang
> David
>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ