From patchwork Wed Nov 11 03:21:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Qinglang Miao X-Patchwork-Id: 323295 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=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 18154C388F7 for ; Wed, 11 Nov 2020 03:17:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C5524205ED for ; Wed, 11 Nov 2020 03:17:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726097AbgKKDRA (ORCPT ); Tue, 10 Nov 2020 22:17:00 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7205 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbgKKDQ7 (ORCPT ); Tue, 10 Nov 2020 22:16:59 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CW8z20C7gzkhWS; Wed, 11 Nov 2020 11:16:46 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Wed, 11 Nov 2020 11:16:49 +0800 From: Qinglang Miao To: Pavel Machek , Dan Murphy CC: , , "Qinglang Miao" Subject: [PATCH] leds: lp50xx: add missing fwnode_handle_put in error handling case Date: Wed, 11 Nov 2020 11:21:59 +0800 Message-ID: <20201111032159.17833-1-miaoqinglang@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Fix to goto child_out to do fwnode_handle_put(child) from the error handling case rather than simply return, as done elsewhere in this function. Fixes: 242b81170fb8 ("leds: lp50xx: Add the LP50XX family of the RGB LED driver") Reported-by: Hulk Robot Signed-off-by: Qinglang Miao --- drivers/leds/leds-lp50xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 5fb4f24aeb2e..49a997b2c781 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -488,7 +488,7 @@ static int lp50xx_probe_dt(struct lp50xx *priv) mc_led_info = devm_kcalloc(priv->dev, LP50XX_LEDS_PER_MODULE, sizeof(*mc_led_info), GFP_KERNEL); if (!mc_led_info) - return -ENOMEM; + goto child_out; fwnode_for_each_child_node(child, led_node) { ret = fwnode_property_read_u32(led_node, "color",