Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1133478pxj; Sat, 29 May 2021 04:21:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzwlN7KPTDYWYkzgY9WlusRVX2f19ze4NyWjWwaApmmCwseOS2bCx47d2QXzMlEDjY+Rhn X-Received: by 2002:a05:6e02:1a68:: with SMTP id w8mr10901078ilv.122.1622287313356; Sat, 29 May 2021 04:21:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622287313; cv=none; d=google.com; s=arc-20160816; b=fjstX8ffmG/noW2caZrhRzvBG9bdg12ovPIo2e0c6C3Cw/f/2RxMPREnN4F/XbvQ3r ALsn+0CblJTDtu49rtlvf//i0GCyytexW4pV+MNDTkN8NGi7pDf30M1vigEgXjp9sqaQ bIS5N8kZkt76uB/F6CpGUyYCMMKTUNuVddvgPd7/Coly+Y5lpiTumKBe+BvOA99VJstG Ne0It5iNLHNsfUyL31qbUbkcjawARnjuwe34LubXWuLhTH4fJbFUTatJzWju+uYutD/O 2VkNlFBEIAxzlAGNz+ecP2+qgtwzk8PQzIaKrb+emZicxtF0+E24aONbKncI/eNYRbE2 xhjg== 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:to:from; bh=lAGHeLqAEGMfa5J6kcvt7AXivDaLNUOxUobeTqAfEPU=; b=cMAMaBWMXjVFkEfGnHcLNa63Ns102Y5roinysgP3c/2xiLtbXRyb41Gf2yTmOuyBH3 1YagTbQ8KxgiRDVfEu/fdUiQv1j5L2iuFCFOyPhKco8zrNjbNoKMWonjq3BHkIEjjhXL UH+42K/PovB5Kn43vstVwFUS2XeDR1Ayl14zjE19OUrmBmtAacQQvms7o+HLF/PsHfe2 1WyfhBHWNWYjLY0+Hg4vRPJaoKRgWAWlAq6hDtvSC44ZOjwSnK16qJFIxWNkxRy4oD5q 4yxvSpHVqjEL3UKYTGVevR0Pkd5msuC/JpeQPvGyzhZVsmdfI/7Ivil64tes2SxMoDlf 3xSA== 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 k23si8503995iom.85.2021.05.29.04.21.40; Sat, 29 May 2021 04:21:53 -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 S229867AbhE2LVx (ORCPT + 99 others); Sat, 29 May 2021 07:21:53 -0400 Received: from fgw20-7.mail.saunalahti.fi ([62.142.5.81]:27498 "EHLO fgw20-7.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229799AbhE2LV0 (ORCPT ); Sat, 29 May 2021 07:21:26 -0400 Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id c6954bdc-c06f-11eb-ba24-005056bd6ce9; Sat, 29 May 2021 14:19:47 +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 Subject: [PATCH v2 12/13] leds: rt8515: Put fwnode in any case during ->probe() Date: Sat, 29 May 2021 14:19:34 +0300 Message-Id: <20210529111935.3849707-12-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_available_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: e1c6edcbea13 ("leds: rt8515: Add Richtek RT8515 LED driver") Cc: Linus Walleij Signed-off-by: Andy Shevchenko --- v2: no changes drivers/leds/flash/leds-rt8515.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/leds/flash/leds-rt8515.c b/drivers/leds/flash/leds-rt8515.c index 590bfa180d10..44904fdee3cc 100644 --- a/drivers/leds/flash/leds-rt8515.c +++ b/drivers/leds/flash/leds-rt8515.c @@ -343,8 +343,9 @@ static int rt8515_probe(struct platform_device *pdev) ret = devm_led_classdev_flash_register_ext(dev, fled, &init_data); if (ret) { - dev_err(dev, "can't register LED %s\n", led->name); + fwnode_handle_put(child); mutex_destroy(&rt->lock); + dev_err(dev, "can't register LED %s\n", led->name); return ret; } @@ -362,6 +363,7 @@ static int rt8515_probe(struct platform_device *pdev) */ } + fwnode_handle_put(child); return 0; } -- 2.31.1