Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2891701pxk; Mon, 28 Sep 2020 02:59:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRBLrku5/GqdYMQQbyUWcQ4ShQ5WC/tqzMfe9PLq+txFZhSFd35Yg4HAcmj+nNszOmn3C9 X-Received: by 2002:a17:906:4553:: with SMTP id s19mr784554ejq.475.1601287194559; Mon, 28 Sep 2020 02:59:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601287194; cv=none; d=google.com; s=arc-20160816; b=fgmb4Sph976FVmlDUxEypADY3sucBHdWYeMSyWtGF7wC0pTzZ/PFV/otas56ktnRwI S6Ctv4mhoqpDXe2ifbTI4gd9MEXeAx+hKL7GLPiSSzWUpZXy2z/HbAlZ/3VLwk+3bfmf aSv+esVQKbW71x+jkkVMMBXg9xFp5mRnMb/maaWLxghcpe+D7lw3f3/SvbOGQSIHUEmX pzd4SyFCYg1859EEdJtGTeY6eaUVowQ9FMyMwFcWBfHjEn4x2u0lajSB2xtS5pJMF6dP 5djzeQ0vXGY5xO3hYl1mfksn+5M2tfBJex92vYLjf2zsRYfT7cI4Ox1VK2gAYlHJQB/D vFRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Bynqe8oqfLSmRS8jPy3IQGtOrQle4bDHlhly7glDXtE=; b=hhNbObN1reHVLutoyeqhOfHSEDipi5H+x8WtPVoGe3D+kc4bUkvmeVN7cfruI5g3UJ rSpBH/CvB+VToRdKhEwexDCxABi2SjT2JNIKCGL6r4JwQB8GWANukZyqAxcwvj2dwuIN 1cfS4B/ej3kPpFvOGa2P0nlGDOa2RNFWfBqkvbcadYQceP6SR42zkT4Qqng2avI0+OO2 +0J0xb4jaaA7/DPemJVyZwJ9emN3NENdXDFKvZttSmvGnww3jJR+W+Iifh9ri0PYIx1W NKz+GwWU75Bu27ne9KgeKuvqnO+nDbvjR49VkLpgDqAesWZKSe1a8lDdRx+THCIZOwlk qJAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="E6pi/58h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p18si276141edy.100.2020.09.28.02.59.31; Mon, 28 Sep 2020 02:59:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="E6pi/58h"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726625AbgI1J62 (ORCPT + 99 others); Mon, 28 Sep 2020 05:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726552AbgI1J62 (ORCPT ); Mon, 28 Sep 2020 05:58:28 -0400 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F3C1C061755 for ; Mon, 28 Sep 2020 02:58:28 -0700 (PDT) Received: by mail-il1-x141.google.com with SMTP id q4so590640ils.4 for ; Mon, 28 Sep 2020 02:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Bynqe8oqfLSmRS8jPy3IQGtOrQle4bDHlhly7glDXtE=; b=E6pi/58he3Bw+tuVCJbgXrJPbzgzvilKEDqpPwZ6gDn4Y3NLB9WHKZVomKAoHyYgyw Pf/fvJFUPbY1TAJTKewr93xn76mzrr0DHIylwkGiejOR6rA2kT/dIa9u8PngfJphK8UO y3uA3ABoePxwD06j8F3cSTq+fNqADptlbwN11t1cQp3lPAzxj3wZoKopB8Glto4cM8f9 EvkBygwREatGM2BurfQ7g/KzI/mYn2WQDh0UCxm3aFIb+aenjVZqx0sj5vHYrsUY/z9o SCHhYORqNAzwkDMCk+kzQkkN2h73nJbgRCh9SEG8VwXIPJa254vcVoCtD8hsPaXp7cE4 qDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Bynqe8oqfLSmRS8jPy3IQGtOrQle4bDHlhly7glDXtE=; b=SIsR9KSUtf2ZUJdZ6njwOCW0yeWT2uhdRASlyUTiiBII5/OYIaGDwlcSJKTo/PqWb7 59RrdAOy0PpHm1YcsuJO17s4AcNkBabSOY1hSjF53X96z3dZT2LOwyj7ygcL6j/x57jj B0max/ZuEDVf7f36AenmIZT1F881hpq6mPn+x2444MTvIIfg2f8ctReIo5rRV0+mfqj8 LJ3reyxn2VwPFbOPHLyzVyEMpeLL89XtID0tyq7iLqN4hJwHwjLeEglKWPm/MgvD4Zsy slIv6JMAwFlEY8PL6pGFhndUhWy3e0iXLz7XrTSXdUzLDa7LgVg35D06lVHIr4L7arrv R/JA== X-Gm-Message-State: AOAM530E/KFH87KogKwYAc8tudcgeELsbR0f30FuJ2KUv0EXQkguYp6/ zpLpFNvZd9f/iKMgI8VA6/IMnI11ZGyHervluw26rQ== X-Received: by 2002:a05:6e02:f10:: with SMTP id x16mr444999ilj.220.1601287107416; Mon, 28 Sep 2020 02:58:27 -0700 (PDT) MIME-Version: 1.0 References: <20200924113842.11670-1-brgl@bgdev.pl> <20200924113842.11670-9-brgl@bgdev.pl> <20200925090329.GZ3956970@smile.fi.intel.com> <20200925123000.GD3956970@smile.fi.intel.com> In-Reply-To: From: Bartosz Golaszewski Date: Mon, 28 Sep 2020 11:58:16 +0200 Message-ID: Subject: Re: [PATCH 8/9] gpio: mockup: use the generic 'gpio-line-names' property To: Andy Shevchenko Cc: Andy Shevchenko , Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio , linux-doc , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 28, 2020 at 11:11 AM Andy Shevchenko wrote: > > On Mon, Sep 28, 2020 at 11:45 AM Bartosz Golaszewski wrote: > > On Fri, Sep 25, 2020 at 6:41 PM Andy Shevchenko > > wrote: > > > On Fri, Sep 25, 2020 at 01:40:10PM +0200, Bartosz Golaszewski wrote: > > > > On Fri, Sep 25, 2020 at 11:03 AM Andy Shevchenko > > > > wrote: > > > > > On Thu, Sep 24, 2020 at 01:38:41PM +0200, Bartosz Golaszewski wrote: > > ... > > > > > > > + kfree_strarray(line_names, line_names ? ngpio : 0); > > > > > > > > > > Perhaps you may check for NULL pointer in the kfree_strarray() and drop ternary > > > > > here? > > > > > > > > > > > > > I did in the previous series and you told me to not to. :) > > > > > > Hmm... What was my argument? What was wrong with me? free() should be NULL-aware. > > > > Well, it is - your just need to make sure ngpio is 0 too. :) > > Do you really need that? If you have NULL as a first parameter, the > second one can be anything. > > > I'll revert back to having the NULL check. > Yes that's what I'm saying but under patch 1/9 you previously said: -- Shouldn't we expect that caller will supply NULL, 0 and above check is not needed? -- this is why it works like this in v1. Bartosz