Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp2584440rwe; Sun, 16 Apr 2023 00:43:24 -0700 (PDT) X-Google-Smtp-Source: AKy350an4rlKipDCKWHk5Nb7Rosh5wF4IjlWryQ1k24qK2GaMBsPa1Hx20NE3lPlUrOh2RPNtjWy X-Received: by 2002:a17:90b:28d:b0:246:9170:a9be with SMTP id az13-20020a17090b028d00b002469170a9bemr11444184pjb.13.1681631003993; Sun, 16 Apr 2023 00:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681631003; cv=none; d=google.com; s=arc-20160816; b=vv6FmwWnRxqg+K/ie6sPmmeAGAMNMUNlRaPuh3JzO2jLA1VnMk4nmPQU29bJ999+fa JJzqdnBDRLiEXyBd8Br5juR/uHD4HNTpdy/EBCWcJsGO8kqiRcXXpnvVHF9Gh7PObvvI LxhRg3j5FF6RenxHd9lgOPctW6XLAxB5e3TgsIs6WH/EZLG8r1pTz1zRBNODQg0lSNvU vN+FnXxPMzV9HmD0YIddosBq5Q28O1fsPKR0nJmYQQXFTN2g8tN9tsXPcVT55vQDf7Rq YrDfdRqFZezxvdunxpJIkK/gfcplX90fKcXF58iEIRvzAhqcSSIme99lXPK9eB6RMCpL Ausg== 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 :message-id:date:subject:cc:to:from; bh=d1bAq1p3wtoJGxakxBPeWlEtLqRXNpCImq6fI/hBL4s=; b=yyRaFTVKec4WGFzkJezBy32c+YBh/W/YwgVRW4lJZPLKbEqOvwn89M1LHUMpvCQP3E P6BVlIGibz7we9SFaag+mGmzoKdszeQm8efQ5d140wV7yzybC38Qj+WvetvAjIua7HvQ JPSgBw1jX+5cSrbxOnOhfqBs006YQTaRYOp4F+/Q6qWfNoV3PseZR2vSFPTqAgIANBQI owZaH3eJn26/L5Nkv9yjPlOP4azf5gE/UTwslhx6cNQxmzItEjVARTb6WCeTnb/c2T08 wxIzghbKjwrz3UbQrtskPyX/qWGHhhGL2ipK3g0G7bg5i3VCoqQbxJB1sevL7uOh3GMU oyUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a17090a9bc200b00246f485f95csi11763246pjw.132.2023.04.16.00.43.11; Sun, 16 Apr 2023 00:43:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229956AbjDPHb7 (ORCPT + 99 others); Sun, 16 Apr 2023 03:31:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229648AbjDPHb5 (ORCPT ); Sun, 16 Apr 2023 03:31:57 -0400 Received: from hust.edu.cn (mail.hust.edu.cn [202.114.0.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E766171C; Sun, 16 Apr 2023 00:31:56 -0700 (PDT) Received: from van1shing-pc.localdomain ([10.12.182.0]) (user=silver_code@hust.edu.cn mech=LOGIN bits=0) by mx1.hust.edu.cn with ESMTP id 33G7Kkuo013655-33G7Kkup013655 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 16 Apr 2023 15:20:49 +0800 From: Wang Zhang To: Peter Korsgaard , Andrew Lunn Cc: Wang Zhang , Dongliang Mu , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] i2c: ocores: add missing unwind goto in `ocores_i2c_probe` Date: Sun, 16 Apr 2023 15:20:40 +0800 Message-Id: <20230416072040.58373-1-silver_code@hust.edu.cn> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-FEAS-AUTH-USER: silver_code@hust.edu.cn X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org platform_get_irq_optional is a function used to obtain an IRQ number for a device on a platform. The function returns the IRQ number associated with the specified device, or a negative error code if it fails. The error handling code after the err_clk label should be executed to release any resources that were allocated for the clock if a negative error code returned. Fix this by assigning irq to ret and changing the direct return to err_clk. Signed-off-by: Wang Zhang Reviewed-by: Dongliang Mu --- drivers/i2c/busses/i2c-ocores.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index a0af027db04c..95efad5a5a28 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c @@ -697,8 +697,10 @@ static int ocores_i2c_probe(struct platform_device *pdev) if (irq == -ENXIO) { ocores_algorithm.master_xfer = ocores_xfer_polling; } else { - if (irq < 0) - return irq; + if (irq < 0) { + ret = irq; + goto err_clk; + } } if (ocores_algorithm.master_xfer != ocores_xfer_polling) { -- 2.34.1