lkml.org 
[lkml]   [2017]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v4 3/4] device property: constify property arrays values
From
On February 2, 2017 8:48:30 AM PST, Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>On Thu, 2017-02-02 at 08:39 -0800, Dmitry Torokhov wrote:
>> From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
>>
>> Data that is fed into property arrays should not be modified, so
>let's
>> mark
>> relevant pointers as const. This will allow us making source arrays
>as
>> const/__initconst.
>>
>
>> Also fix memory leaks on errors in property_entry_copy().
>
>While the code looks okay, I'm not sure what memory leaks you are
>referring to. The idea as far as I remember was to run *free() function
>if *copy() fails.

That could have been OK for internal function, but will not work for public API, as it goes against normal pattern.

You will be old and grey and still correcting patches that would be getting it wrong :)


Thanks.

--
Dmitry

\
 
 \ /
  Last update: 2017-02-02 18:08    [W:0.099 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site