Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1133406pxj; Sat, 29 May 2021 04:21:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3xSBftgD0E3SI6hdq+qxLVQiOw3RRYcG0QtU5OMxKIVR+BHjNNeINMKYLhle3H3VwG02S X-Received: by 2002:a02:9109:: with SMTP id a9mr12829871jag.93.1622287306543; Sat, 29 May 2021 04:21:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622287306; cv=none; d=google.com; s=arc-20160816; b=q4lqpVeHwB8nmaUXJXzMXr0wbgvSOlQHuVNyFh0GQFwdTsSBdMwQF0TE4wIS7/9Nwx Yl8B+v0N1WwjZ/7DeDw7Sr+V1y3Cphep9pDGKHyDEB5tnj37gDqtSXRvgmJde3vLrYln Vy1UXwDbHkH7JbAcXKuEzW7WD3YMnD/5fX7ruMxnrJ7WDwYy4di+msSiFZCEg5xcCGt/ GoLbww3JIwEwERWUR+GwvUZDtQzIEnIG1g49U+wULQY8fHeLir9+uDjG8r6RBgd3sE1H DgNOkXMnICtMejR/vAUe+S0tKNOEmS+v//7OvHJW1+LXoHtdKF1xbchmnoTinmucv39E XTVA== 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=ub8sdE39K3Sd0ICzzkqpYe6tV0hsstKVwNVN4O0SBFc=; b=xvSucVR3TwEMlU3CF9i4MvlCYVfdJBVxzA/f2tc64w6UgHvBkOl3O7TnwZe6iF08GH +43axdvCnuTGQcEKgnO7as9TT2a10FwXp0S56GGWEjAMOwWOWnB2lNmD0DohJAE3UVV3 p+uFGhT4YPTgckaneJT/HHGDF5rl/H67ZEhJS5kWHF0D6oguR31GvgKwErjlB1BS0oCg vLMFaXuGKmFCICrYNNR6b6sDzwzDXZ4Eyc0d/MpJGIkv3q0LZ4gyfzyDu70GDNuROTT3 EsCAMxTInPpQB7yRMxdycSB7mQMclMJUX6HQIfPw2MJ+38sR7ga0DIqJ+cvLihjhaa7T YCKw== 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 r12si9606926ilg.107.2021.05.29.04.21.33; Sat, 29 May 2021 04:21:46 -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 S229901AbhE2LVt (ORCPT + 99 others); Sat, 29 May 2021 07:21:49 -0400 Received: from fgw21-7.mail.saunalahti.fi ([62.142.5.82]:38945 "EHLO fgw21-7.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229792AbhE2LV0 (ORCPT ); Sat, 29 May 2021 07:21:26 -0400 Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id c61ae325-c06f-11eb-9eb8-005056bdd08f; Sat, 29 May 2021 14:19:46 +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: Daniel Mack Subject: [PATCH v2 11/13] leds: lt3593: Put fwnode in any case during ->probe() Date: Sat, 29 May 2021 14:19:33 +0300 Message-Id: <20210529111935.3849707-11-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 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 --- v2: no changes 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 3bb52d3165d9..d0160fde0f94 100644 --- a/drivers/leds/leds-lt3593.c +++ b/drivers/leds/leds-lt3593.c @@ -97,10 +97,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.31.1