From patchwork Mon May 10 09:57:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 12247479 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A8D3C433B4 for ; Mon, 10 May 2021 10:13:29 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA2D9613E1 for ; Mon, 10 May 2021 10:13:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EA2D9613E1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DF66089D83; Mon, 10 May 2021 10:13:27 +0000 (UTC) X-Greylist: delayed 964 seconds by postgrey-1.36 at gabe; Mon, 10 May 2021 10:13:26 UTC Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7600D89D83 for ; Mon, 10 May 2021 10:13:26 +0000 (UTC) Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw20.mail.saunalahti.fi (Halon) with ESMTP id 1b869fa5-b176-11eb-ba24-005056bd6ce9; Mon, 10 May 2021 12:57:20 +0300 (EEST) From: Andy Shevchenko To: Lee Jones , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/1] backlight: lm3630a_bl: Put fwnode in error case during ->probe() Date: Mon, 10 May 2021 12:57:16 +0300 Message-Id: <20210510095716.3302910-1-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jingoo Han , Daniel Thompson , Andy Shevchenko , Dan Murphy , Brian Masney Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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: 8fbce8efe15cd ("backlight: lm3630a: Add firmware node support") Cc: Brian Masney Cc: Dan Murphy Signed-off-by: Andy Shevchenko Reviewed-by: Brian Masney Reviewed-by: Daniel Thompson --- drivers/video/backlight/lm3630a_bl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index e88a2b0e5904..662029d6a3dc 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -482,8 +482,10 @@ static int lm3630a_parse_node(struct lm3630a_chip *pchip, device_for_each_child_node(pchip->dev, node) { ret = lm3630a_parse_bank(pdata, node, &seen_led_sources); - if (ret) + if (ret) { + fwnode_handle_put(node); return ret; + } } return ret;