Re: [PATCH v4 3/4] device property: constify property arrays values

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2017-02-02 at 09:07 -0800, Dmitry Torokhov wrote:
> 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@xxxxxxxxx>
> > > 
> > > 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 :)

Yes, which sounds not exactly as "we have memory leaks and here we are
fixing them". So, my comment regarding to phrasing of the commit
message. Someone might mistakenly think that it needs to be ported as
earlier as this had been introduced.


-- 
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux