Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1246800pxk; Fri, 25 Sep 2020 09:43:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu+Ae7ys25AX8srInQMGrTCcNjA08RJOzO3f24/NlELQxY9j96Tbc0Phfl10qxTK0he67g X-Received: by 2002:aa7:c2d6:: with SMTP id m22mr2199912edp.311.1601052219471; Fri, 25 Sep 2020 09:43:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601052219; cv=none; d=google.com; s=arc-20160816; b=qFJNDEGh1Ha16AiAhyk/BF24+WXNT3noDwI13/e6SKX3LX9246X/VOEQcqNq3lt/w/ gRooC0NxMN+vvUAFsBdWayQU95jcqwAp8okfwm7V1/24Tx9weDmFDZ2E+qN8+dk/IIKi mCjYdjHcMK25Hd2M7G9EBrPH0v/ZQ05X092AhA3PpQ+6/PVoZ1yEJIKAPWk6//0TYhEc gBDjjsMTWv4payksdmXTeJTI97n6a1Mho/4pOw21DTiNmA4ba1VgSzGj5NiRyxYx7aZK jGcB7rnfn6qbhBE9QWwG5xc+QZLRR8sOF0voftFrhwJKL7ua1nuVBFJV3TY7tHMlo194 qJuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=lg0dwsSDGY1aeyTyC4M7IUUD+5rOJggWjy+R4y3xHFs=; b=gjXjFFS2RBOsiZUjTVM4xwibEppwUWiyMpiyogWmek6iCgksOq3AyOVSECEMAY7AXg 6fVqg5HQZOOcpk6DVlKVHXEOQXh1B7foUW4D2asAFAln8mS76WeDSkTHxBSoxu8abhDd 0ykCRLHZRtt2Ti5Qh0ZzqpTbqFVf2Em3D1P1FZdJrdB8jr4b3uD6vgWrplyGLnuPwsuP dQCZX7xgaOgtcGugbQhfFm6gbeuYlIFv6KR86nHoP+EDSKi7ZWzPn+7m934wDqL9969K CKRswxgSM2fKW6PMvGuhT95hcs1uDLmJp5ifIpuUnf5J5vdeQFUOmKKkEj/oXaDFMIHi rHlQ== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v12si2530974edl.552.2020.09.25.09.43.15; Fri, 25 Sep 2020 09:43:39 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729565AbgIYQlI (ORCPT + 99 others); Fri, 25 Sep 2020 12:41:08 -0400 Received: from mga03.intel.com ([134.134.136.65]:28196 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726990AbgIYQlH (ORCPT ); Fri, 25 Sep 2020 12:41:07 -0400 IronPort-SDR: 4tYFPzOYUsW/q5LT2sKGDoHb+6pRK5WtgzU9McIKBXZKE2//9ZNRH6s+n+eFxbqhTBBwCdvvg5 ANakS9crxHPQ== X-IronPort-AV: E=McAfee;i="6000,8403,9755"; a="161667547" X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="161667547" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 09:41:06 -0700 IronPort-SDR: NzOnULLjjtadOZgBjjeoL4UErQg+tVTLHrrNRTTaakimhjOfWOSfVeVwSPj+ibb/rnOqh3gxvB B9rhpk/2i6uw== X-IronPort-AV: E=Sophos;i="5.77,302,1596524400"; d="scan'208";a="292811695" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2020 09:41:04 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kLmrQ-001uuf-NO; Fri, 25 Sep 2020 15:30:00 +0300 Date: Fri, 25 Sep 2020 15:30:00 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Bartosz Golaszewski , Linus Walleij , Jonathan Corbet , Kent Gibson , linux-gpio , linux-doc , LKML Subject: Re: [PATCH 8/9] gpio: mockup: use the generic 'gpio-line-names' property Message-ID: <20200925123000.GD3956970@smile.fi.intel.com> References: <20200924113842.11670-1-brgl@bgdev.pl> <20200924113842.11670-9-brgl@bgdev.pl> <20200925090329.GZ3956970@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: > > > From: Bartosz Golaszewski > > > > > > GPIO line names are currently created by the driver from the chip label. > > > We'll want to support custom formats for line names (for instance: to > > > name all lines the same) for user-space tests so create them in the > > > module init function and pass them to the driver using the standard > > > 'gpio-line-names' property. > > > > ... > > > > > + if (gpio_mockup_named_lines) { > > > + line_names = gpio_mockup_make_line_names(chip_label, > > > + ngpio); > > > + if (!line_names) { > > > + platform_driver_unregister(&gpio_mockup_driver); > > > + gpio_mockup_unregister_pdevs(); > > > + return -ENOMEM; > > > + } > > > > > + properties[prop++] = PROPERTY_ENTRY_STRING_ARRAY_LEN( > > > + "gpio-line-names", > > > + line_names, ngpio); > > > > Forgot to update GPIO_MOCKUP_MAX_PROP? > > > > No, there are still three properties: chip-label, nr-gpios and > gpio-line-names. Same answer to patch 8/9. > > > > + } > > > > ... > > > > > + 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. -- With Best Regards, Andy Shevchenko