Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1840961pxb; Mon, 13 Sep 2021 06:43:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2BdPi2gcK0w5FYaEeD0bTiAlM+CEnK4gbwqI8YrT7dTwHqw2UcQXbb6SRYve7ruuZPk5x X-Received: by 2002:a05:6e02:2145:: with SMTP id d5mr7978682ilv.214.1631540603209; Mon, 13 Sep 2021 06:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631540603; cv=none; d=google.com; s=arc-20160816; b=iMcE1ScWb5Q3edExO0S/c/llhbVUJLGRD6E4N1Lku0sSuNSffmaZ6HIGTQxAsqeaum brQVQUjioB0BVx2nAqKdy+dXPgPD0pkGtlqMSs8LVBb5WQP4tXRmjiA7xpWakGBAl1H4 jJzeegCPDEs87J90gCeUGFwr8LEoT963zF0KPye1YVWous2Uq6fycj3Gefa4HNVZ68b1 qukVyL2RL2Bo7hdpkEKVy3a+nNDNyGEkRE2WmxqjJnTs9y0GBIjCc8kHzUYlk9WKd5JW SjCiJ41nrYoEupS1tt9ldLksXzR3hnYTl1p5jv2r2/cGxQ7kO1i+VYVOO/j6uand/2j6 03jw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mrmsRwuNCha7nYNWZtMKaeBA9IoUGmHUNPHrnWaszWY=; b=B/UiIPUZ139/ZfILfDTGNbxB6E7uZJkxRzx9fXH5ouY9I/nwgStBynvL0yhV7VakSy bCDnODYsHF6P4QyTkMB5dkVJq2pQSOnlwu4FzWZaxR1VZpXRa/nUzWXY7ZylcXtEFoLv ty/YfttpEznxOqgxdAWPo54ZaRQD+ZWL9H2Evlyx7hnQBws5jLkUdnOePTDLjzgD1dOE Sgn0Q6Rkzm5kZDTGTnlTk8DdG35DQ+QJkne5mqL4CZ8/ByRMtB05V+ssdtbpwbInuCV7 utzISPPZpQLlYAy41fC4JYawU+j3HRnG5X5eQjQz7apeaxeslwFfwUrWJ11DNqWPDID6 tFmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uyG9tBhu; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t24si6081701iog.114.2021.09.13.06.43.06; Mon, 13 Sep 2021 06:43:23 -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=@linuxfoundation.org header.s=korg header.b=uyG9tBhu; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235759AbhIMNmw (ORCPT + 99 others); Mon, 13 Sep 2021 09:42:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:34930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241060AbhIMNhO (ORCPT ); Mon, 13 Sep 2021 09:37:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B9535613C8; Mon, 13 Sep 2021 13:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631539689; bh=VGfrlLeyZpJAMnY7uRbr2GjzlXrk2XeA58ScRZnuOnY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uyG9tBhul0WVCUD10X0XVmKUiokxWJZH5ZW6W/CNsd0cUgisP+FMck9zZgP0kqQLD AiiDlzbQCe3CmYOORomlm4OWO7YhWbR6UDEDQPmvmE4QS/ew6C6dyUu3TAhX+3++VJ H1zl5+5KEtresQF88gimd6qwXQFyu8rGwvNxyjq4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Daniel Mack , Andy Shevchenko , Pavel Machek , Sasha Levin Subject: [PATCH 5.10 121/236] leds: lt3593: Put fwnode in any case during ->probe() Date: Mon, 13 Sep 2021 15:13:46 +0200 Message-Id: <20210913131104.472980166@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131100.316353015@linuxfoundation.org> References: <20210913131100.316353015@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit 7e1baaaa2407a642ea19b58e214fab9a69cda1d7 ] device_get_next_child_node() bumps a reference counting of a returned variable. We have to balance it whenever we return to the caller. Fixes: 8cd7d6daba93 ("leds: lt3593: Add device tree probing glue") Cc: Daniel Mack Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek Signed-off-by: Sasha Levin --- drivers/leds/leds-lt3593.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/leds/leds-lt3593.c b/drivers/leds/leds-lt3593.c index 68e06434ac08..7dab08773a34 100644 --- a/drivers/leds/leds-lt3593.c +++ b/drivers/leds/leds-lt3593.c @@ -99,10 +99,9 @@ static int lt3593_led_probe(struct platform_device *pdev) init_data.default_label = ":"; ret = devm_led_classdev_register_ext(dev, &led_data->cdev, &init_data); - if (ret < 0) { - fwnode_handle_put(child); + fwnode_handle_put(child); + if (ret < 0) return ret; - } platform_set_drvdata(pdev, led_data); -- 2.30.2