From mboxrd@z Thu Jan 1 00:00:00 1970 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.7 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=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 88336C48BE5 for ; Tue, 15 Jun 2021 21:51:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6C90261241 for ; Tue, 15 Jun 2021 21:51:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231441AbhFOVxV (ORCPT ); Tue, 15 Jun 2021 17:53:21 -0400 Received: from fgw21-7.mail.saunalahti.fi ([62.142.5.82]:42402 "EHLO fgw21-7.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231354AbhFOVxU (ORCPT ); Tue, 15 Jun 2021 17:53:20 -0400 Received: from localhost (88-115-248-186.elisa-laajakaista.fi [88.115.248.186]) by fgw21.mail.saunalahti.fi (Halon) with ESMTP id cdd81c57-ce23-11eb-9eb8-005056bdd08f; Wed, 16 Jun 2021 00:51:13 +0300 (EEST) From: Andy Shevchenko To: Prashant Malani , linux-kernel@vger.kernel.org Cc: Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Andy Shevchenko Subject: [PATCH v2 1/1] platform/chrome: cros_ec_typec: Put fwnode in error case during ->probe() Date: Wed, 16 Jun 2021 00:51:11 +0300 Message-Id: <20210615215111.377348-1-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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: fdc6b21e2444 ("platform/chrome: Add Type C connector class driver") Signed-off-by: Andy Shevchenko Reviewed-by: Prashant Malani --- v2: added comment (Prashant), added Rb tag (Prashant) drivers/platform/chrome/cros_ec_typec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/platform/chrome/cros_ec_typec.c b/drivers/platform/chrome/cros_ec_typec.c index 27c068c4c38d..99fdc1156392 100644 --- a/drivers/platform/chrome/cros_ec_typec.c +++ b/drivers/platform/chrome/cros_ec_typec.c @@ -375,6 +375,8 @@ static int cros_typec_init_ports(struct cros_typec_data *typec) return 0; unregister_ports: + /* Drop the referece that bumped by device_for_each_child_node() */ + fwnode_handle_put(fwnode); cros_unregister_ports(typec); return ret; } -- 2.32.0