From patchwork Sun Mar 26 14:49:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 75099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp991329vqo; Sun, 26 Mar 2023 08:18:00 -0700 (PDT) X-Google-Smtp-Source: AKy350b0Txf+eAWcxaxZ8fjOvwnENTxIG7Pn9RDKMPwhZ3S4771kBWZntho661hINDR7PH7tBawt X-Received: by 2002:a17:902:e5d1:b0:19e:4bc3:b1ef with SMTP id u17-20020a170902e5d100b0019e4bc3b1efmr10967780plf.64.1679843880589; Sun, 26 Mar 2023 08:18:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679843880; cv=none; d=google.com; s=arc-20160816; b=Rxjhe6HD7CIRNhA1S7MbYUFFWwpinZABgwfBTi2aVlcs7jZScgzrIhrUlBaar3cEqU oR+DLiUIPNpoU3fR0wlNWw7Mbq1NcwwUv/ppy2Upp/E31AX6q4TrYqbPi6DxDVogyfLt syH/jY23vp9QjNYwbYpG15XfaCjagGbFO18KRk9rP0BMUBFsatNTgOSnFr5whW9ITVTF 76IPL2gH0TiWowHsrVZB9nFrCRJm7Bj5Qc1M+Ca6m+97muQ1jNc9qk+TrGY472k1QHKI 43DyIqt02fKpgn9qSorB5twRPwYPsrM4766+IZhARdPIrabpMifldk8gwCXsab5M6pNA hGaA== 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=bhc1K86p4I2BJpoh1f3AxKrdrDq/NoTz/qa8gLQPN6A=; b=hJKZaZdyYmVeb/qovr7vMcHN1M5/XkBFBFcyoddtxK4dJOPWASdzr8n7s7OIgQGSTy 079DzgxKqyvHrVsQeZdUKDV42vft/JvvOJhZU+JKHTCdX5unDff9+2Pc/gr4hFFkH2MH KSPlGWgKfxEdEe19BRiRRfotTIdbzJlczPbXTXlH83MNImAwJRa6N6yID9t+L+/Z3FhH 85jtPD451bPtt/3WkV7ExESWZ5P2cjoxMvaHqHO4u1876McYmFOTwoFcn7GznHOO5Ate q+6fdZHhbD17aryRaYghIqD0J0yzXEBMo9vQMI6ZyLWXdcVFwPBMPyFJocOZkSFES2Qo tqzw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w10-20020a170902c78a00b0019b0b007994si24129026pla.163.2023.03.26.08.17.48; Sun, 26 Mar 2023 08:18:00 -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 S232019AbjCZO4y (ORCPT + 99 others); Sun, 26 Mar 2023 10:56:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbjCZO4x (ORCPT ); Sun, 26 Mar 2023 10:56:53 -0400 Received: from smtp.smtpout.orange.fr (smtp-28.smtpout.orange.fr [80.12.242.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8E9594C22 for ; Sun, 26 Mar 2023 07:56:52 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id gRgCpQ21Z6OWigRgCpM9dQ; Sun, 26 Mar 2023 16:49:10 +0200 X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 26 Mar 2023 16:49:10 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Alex Helms , Michael Turquette , Stephen Boyd Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-clk@vger.kernel.org Subject: [PATCH] clk: versaclock7: Fix an error handling path in vc7_probe() Date: Sun, 26 Mar 2023 16:49:06 +0200 Message-Id: <68c2fac5e774088437200aaeca8737a691bf951c.1679842132.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761443977021444728?= X-GMAIL-MSGID: =?utf-8?q?1761443977021444728?= If an error code other than -EPROBE_DEFER is returned, it is likely that there will be some trouble when: __clk_get_name(vc7->pin_xin) is called a few lines below. __clk_get_name() only checks for NULL. Fixes: 48c5e98fedd9 ("clk: Renesas versaclock7 ccf device driver") Signed-off-by: Christophe JAILLET --- This patch is speculative and compile tested only. --- drivers/clk/clk-versaclock7.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c index 8e4f86e852aa..8d11e68e94b2 100644 --- a/drivers/clk/clk-versaclock7.c +++ b/drivers/clk/clk-versaclock7.c @@ -1111,8 +1111,8 @@ static int vc7_probe(struct i2c_client *client) vc7->chip_info = of_device_get_match_data(&client->dev); vc7->pin_xin = devm_clk_get(&client->dev, "xin"); - if (PTR_ERR(vc7->pin_xin) == -EPROBE_DEFER) { - return dev_err_probe(&client->dev, -EPROBE_DEFER, + if (IS_ERR(vc7->pin_xin)) { + return dev_err_probe(&client->dev, PTR_ERR(vc7->pin_xin), "xin not specified\n"); }