From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbdBBRHj (ORCPT ); Thu, 2 Feb 2017 12:07:39 -0500 Received: from mail-pg0-f67.google.com ([74.125.83.67]:34341 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751394AbdBBRHh (ORCPT ); Thu, 2 Feb 2017 12:07:37 -0500 Date: Thu, 02 Feb 2017 09:07:30 -0800 User-Agent: K-9 Mail for Android In-Reply-To: <1486054110.2133.366.camel@linux.intel.com> References: <20170201173125.40354-1-dmitry.torokhov@gmail.com> <20170201173125.40354-4-dmitry.torokhov@gmail.com> <1485991803.22276.14.camel@perches.com> <1605853.brEpCT4tOG@aspire.rjw.lan> <20170202163918.GA21924@dtor-ws> <1486054110.2133.366.camel@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Subject: Re: [PATCH v4 3/4] device property: constify property arrays values To: Andy Shevchenko , "Rafael J. Wysocki" CC: Joe Perches , "Rafael J. Wysocki" , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Westerberg , Hans de Goede , Wolfram Sang From: Dmitry Torokhov Message-ID: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v12H7gof030514 On February 2, 2017 8:48:30 AM PST, Andy Shevchenko wrote: >On Thu, 2017-02-02 at 08:39 -0800, Dmitry Torokhov wrote: >> From: Dmitry Torokhov >> >> 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