Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3103888pxj; Mon, 14 Jun 2021 14:38:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6NVeKKPeIdY+gs6CBOQ7APJC0VkNqi0hbzAzohSOQCyrJrmJRRFVxuQkEaWhJciItK94n X-Received: by 2002:a17:906:2e81:: with SMTP id o1mr246567eji.446.1623706723954; Mon, 14 Jun 2021 14:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623706723; cv=none; d=google.com; s=arc-20160816; b=u7U0rGfBUrCPbl/ED0cE/s0/LWsyeQ78OaMR5VYeKZ4Bp0vh644qajD7WhQS0y/jII S2Gy68DkPt5gm1WGQoACVZMHrbAeKzTte5TlgWb3/czYefSQTCdA5BG8PymcMQ0kiZ0m eWC7XELl1HRkE5vfG0+J/ww230mUWHbHRAZ6fIJFbqb8lyeAJpIKg0RkOA8hAr7q1QQT MBIu9sH9xKeTWYhEsOT5lHCtjlaeFQrtyw90/OciRCZ/9lL0sf42RgLlHg8IiPEl951L e6NtfVf9KRkk7weKznaF/TX+DAgleUz909slL5+5ud5YNhgEs5v+11gU8xsOExMCAOsV rzRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YAazy044guK0npar/4m+sPmQIOtSucx//piB7AyNprc=; b=CnT6w5cVJCCGmNLAtOi8xaI39aTfnNJqOOw4/l+pdZ+OCA1+RkpiU30jEEdhYCrNlU kcUGg/jCYEaDJBkoIPprKSyLkWcTJwIrWTPBXBq2CLzmZKuIq8ZKiKJZivP8IxjeDhi2 88G/ONogCSTdD4KJpB8cjDlC/4Ya96pjHy2j+o70yYbqbzzMDXrkIIZjLtTvDDpt5KWT my+AYDP0dfXPLykhBtyO4z2f8nTV34LvFqerdto13QRBqCJfBjnfM5NRSu/DwCSFVB+D akF2ku4/pHT1NUgqr7XPet5BBtqWDYgkEHk8LzyFWbssqOZ09FlJ5LzPT7iFMcgj9spK FuBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Z7xW+wRk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i13si12512897edc.250.2021.06.14.14.38.21; Mon, 14 Jun 2021 14:38:43 -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=@chromium.org header.s=google header.b=Z7xW+wRk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232743AbhFNVgr (ORCPT + 99 others); Mon, 14 Jun 2021 17:36:47 -0400 Received: from mail-pg1-f177.google.com ([209.85.215.177]:42881 "EHLO mail-pg1-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbhFNVgr (ORCPT ); Mon, 14 Jun 2021 17:36:47 -0400 Received: by mail-pg1-f177.google.com with SMTP id i34so9734288pgl.9 for ; Mon, 14 Jun 2021 14:34:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YAazy044guK0npar/4m+sPmQIOtSucx//piB7AyNprc=; b=Z7xW+wRkbGrbzLJ5EtWsRaDHBI5oP2nbOTXGnc0u9JN6J1Za57bhRzNCQK90E+aTzV B1C1RMN/oPNJT0a1Ak5hklQAl82aWGfszjBE3KsufZ3CS7JGEBBMGfkVH6nRRgdesEyc 8ffYuR0FAX0ar0MbAIfm+0yz2ptTdtoHH5ejo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=YAazy044guK0npar/4m+sPmQIOtSucx//piB7AyNprc=; b=Bo3YGoWqJj9uq+O5+kx8sa2YSWoPPm9U3mRpLsV4r0kxDk/8NfMRkOsGairZwqDiMh wa7V8Ac428Hr7LKXPy9bpQ4Rql7Si8srSDRKKHppaEHgh9+2CBBa4ALUHNr+EuKEcA3a VcVHXgzHMdMgFPsz0gHxyQSVpxmfaUwZPE0DMuHeNplDloEkPTUlFeQ4NNbcqxwDq3Cw cYRPJ+hUWoi+N5q8g7ksuEY8TtlsOa5FlTo58JvxrhWeeIsXOxEMMGjh0Pkm3z7BplVb Sn5/UMFfj4dhD1z1z5NG2YZnxBn450HMh3zeuJr19QLYqy+nXUn34U81XwI8kaVULCEI WLag== X-Gm-Message-State: AOAM531dhw8/Tf2GdSmXNYXDeR+Gxsh6Qfw6126uIRQU/L/Kpl5woeVf in5lVJlCM0TEl07uEiiNdB/pwg== X-Received: by 2002:aa7:8b4f:0:b029:2bd:ea13:c4b4 with SMTP id i15-20020aa78b4f0000b02902bdea13c4b4mr1073202pfd.48.1623706407494; Mon, 14 Jun 2021 14:33:27 -0700 (PDT) Received: from google.com ([2620:15c:202:201:ea91:688d:ccf2:cf48]) by smtp.gmail.com with ESMTPSA id x23sm163375pfh.172.2021.06.14.14.33.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Jun 2021 14:33:26 -0700 (PDT) Date: Mon, 14 Jun 2021 14:33:25 -0700 From: Prashant Malani To: Andy Shevchenko Cc: linux-kernel@vger.kernel.org, Benson Leung , Enric Balletbo i Serra , Guenter Roeck Subject: Re: [PATCH v1 1/1] platform/chrome: cros_ec_typec: Put fwnode in error case during ->probe() Message-ID: References: <20210614203310.339541-1-andy.shevchenko@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210614203310.339541-1-andy.shevchenko@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Mon, Jun 14, 2021 at 11:33:10PM +0300, Andy Shevchenko wrote: > device_for_each_child_node() bumps a reference counting of a returned variable. > We have to balance it whenever we return to the caller. > > Fixes: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver") > Cc: Prashant Malani > Signed-off-by: Andy Shevchenko Minor nit, but regardless of that: Reviewed-by: Prashant Malani > --- > drivers/platform/chrome/cros_ec_typec.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c > index 27c068c4c38d..fb03c22fa34d 100644 > --- a/drivers/platform/chrome/cros_ec_typec.c > +++ b/drivers/platform/chrome/cros_ec_typec.c > @@ -375,6 +375,7 @@ static int cros_typec_init_ports(struct cros_typec_data *typec) > return 0; > > unregister_ports: > + fwnode_handle_put(fwnode); It reads better to have this at the location where the goto's are called, but there are several of them. Instead, can you add a 1-line comment explaining that the reference is left over? It isn't clear even by going a few calls down the stack of device_for_each_child_node(). Best regards, -Prashant