Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1134059pxj; Sat, 29 May 2021 04:22:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbgP5N3mrYvETuyKSQke2irB+t4y/EjBoXjhB9zsv2v/hSj2bMKkdvdznXX/KwuzPCOZvI X-Received: by 2002:a92:cec2:: with SMTP id z2mr1397460ilq.58.1622287379643; Sat, 29 May 2021 04:22:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622287379; cv=none; d=google.com; s=arc-20160816; b=tJJrvQC3MzE98VM4h0lLssnKF5c0Be44MGpTGHRUP9auABhTfEAGJUMoRNwbTCqYIl 29eYtdnp4nfCS+YUvKDgdEkxqHuuOFln40m0NwBglrtBImLffgm96EaRZrv4OAQCJClB ooVAluNQftbo4wmiuQJeR9YweKctqLOrYTfzj3Fu/l/3MCECj0k9HW/8m/+ukSFht6/F 1b7n/MT8Xobss1hFvF5fgvQja+7rgTp9NVDQsP+UI9Dwzpx6O3BhvcCmv9EUnQ4sd1Of 4EbuETqDMxwI3uX8RabRxwCfb6FQRpsZPiZvy6oIE5THr179sqdNLFqcqqDKxGWbNUqQ 1gUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=KCeJjzSye2PJdsVqmLK1sjEpNMh2iD8YT78atVo/OHE=; b=mJgY6vTkpkBmLpkHwmwc2IkYcMaJOaOklfPo4ekQKJB3m0QoD64/x1zfSrl94QqYMS qZ+UMKOlc2dUAf8Xo1zVZgpb/TS1R6dic1WV7KIxH9ro+GnGLB2ovJobLo3nW4XUCSZv tOxc9CyP9ZNKEAJ1nbjIqgFUA57pQ7cio2GN/yqFO4tUqTgZHdmZAT1C4ngxrCRIrvCf qtwCOMH4xFZIO0aQwDgcGXVP35GtmO5ssMc7QZ827NPksnVXf5/F908qYF1Ymss4E0p9 CpK0T1aLVkLYK4evpheeTVjhR6pBOXeidzJ8dO+ALO59jlOELACb6Fqg2m7eD6w4VtpM QfWA== 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si6951715iom.14.2021.05.29.04.22.47; Sat, 29 May 2021 04:22:59 -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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbhE2LV6 (ORCPT + 99 others); Sat, 29 May 2021 07:21:58 -0400 Received: from fgw22-7.mail.saunalahti.fi ([62.142.5.83]:14273 "EHLO fgw22-7.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbhE2LV1 (ORCPT ); Sat, 29 May 2021 07:21:27 -0400 Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw22.mail.saunalahti.fi (Halon) with ESMTP id c7064bb3-c06f-11eb-88cb-005056bdf889; Sat, 29 May 2021 14:19:48 +0300 (EEST) From: Andy Shevchenko To: Pavel Machek , Andy Shevchenko , Amireddy Mallikarjuna reddy , Linus Walleij , Abanoub Sameh , =?UTF-8?q?Marek=20Beh=C3=BAn?= , Krzysztof Kozlowski , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Luca Weiss Subject: [PATCH v2 13/13] leds: sgm3140: Put fwnode in any case during ->probe() Date: Sat, 29 May 2021 14:19:35 +0300 Message-Id: <20210529111935.3849707-13-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210529111935.3849707-1-andy.shevchenko@gmail.com> References: <20210529111935.3849707-1-andy.shevchenko@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org fwnode_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: cef8ec8cbd21 ("leds: add sgm3140 driver") Cc: Luca Weiss Signed-off-by: Andy Shevchenko --- v2: no changes drivers/leds/leds-sgm3140.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/leds/leds-sgm3140.c b/drivers/leds/leds-sgm3140.c index f4f831570f11..df9402071695 100644 --- a/drivers/leds/leds-sgm3140.c +++ b/drivers/leds/leds-sgm3140.c @@ -266,12 +266,8 @@ static int sgm3140_probe(struct platform_device *pdev) child_node, fled_cdev, NULL, &v4l2_sd_cfg); - if (IS_ERR(priv->v4l2_flash)) { - ret = PTR_ERR(priv->v4l2_flash); - goto err; - } - - return ret; + fwnode_handle_put(child_node); + return PTR_ERR_OR_ZERO(priv->v4l2_flash); err: fwnode_handle_put(child_node); -- 2.31.1