Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1114372rwd; Thu, 8 Jun 2023 12:19:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7c0rC4uZFmrkZdGB5h76+mxeSMlciZ4cz2/f76OwSpidsuYWBwvdDe0Cban6qR4J5jG2SU X-Received: by 2002:a05:6a00:a1f:b0:65c:e35b:b13a with SMTP id p31-20020a056a000a1f00b0065ce35bb13amr7535338pfh.14.1686251974270; Thu, 08 Jun 2023 12:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686251974; cv=none; d=google.com; s=arc-20160816; b=AjACcoCPCit3AaV3mYBCMWC/vXbrb8+DMCvIZL0yCCTPm9+eWKLcACQhpqc/41GIzh w7Z/Nljs0tr4pjwehsPmRmDTCzQJx+riO/I1W/ENqC4nK4VYzPokAB+2XpwAOOc0Iq8k w8pxiSkoqCWI7Qo+9qcRFHM8km0onycWb0dn6pqm7kLcXdTTzkxrx6JFlRnFIrdUJItS 5hBplYCXTzv+JOY8J+w2KZgunxQVuBE5JKTBxR0C4R3UqbDUTL08LJKhmQ+fBnnQ88ev ysaYQ92BZLZ/RhQa88zKCrS/D1ljO12EGBwHkyktqI6wQDtFdsXnqMGWneQWAjPGuYLX 64bA== 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:dkim-signature; bh=rMbp0A0nCVWbFNITEeTCYWZN0nSZsQCHQh6V232GAHE=; b=JDOLka/E7mbBtyVeSFqhX6splpmKruHveqIodfyk3WeRKf/q6tahqZ0bb5XJBSNBwI JjxKdSjD8HCT+NwdUQmfuaj+762M7zxLcK0n2ZhXWIZqcjNzKvibm84FVdxgL1FDZpTN d71xYvw50Jl53PQqjBMpjEfqBev+s81O83hbouceNdWNNjGHu0tXM6zxwLIa5KFvRkFs rK769Dr5j04zjikqPU+EPAAfY0UfBA2qtsnqSQFb2lBYUOTg1TVT4DuraVwJaol+P5kD ELOKTO/+/J6ElzFFXsMR9r84+pF2XK+el+2X5EeJkwEyg5VIYzOdmlwjGVLH7yfymSTb ZbaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rx4ykTJ6; 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 a5-20020a624d05000000b0065024e5049bsi1174932pfb.334.2023.06.08.12.19.21; Thu, 08 Jun 2023 12:19:34 -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; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=rx4ykTJ6; 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 S235756AbjFHTLw (ORCPT + 99 others); Thu, 8 Jun 2023 15:11:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58520 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233160AbjFHTLv (ORCPT ); Thu, 8 Jun 2023 15:11:51 -0400 Received: from smtp.smtpout.orange.fr (smtp-30.smtpout.orange.fr [80.12.242.30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 804A62D4B for ; Thu, 8 Jun 2023 12:11:49 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 7L2uq3N8w8gUX7L2uqbsxa; Thu, 08 Jun 2023 21:11:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1686251507; bh=rMbp0A0nCVWbFNITEeTCYWZN0nSZsQCHQh6V232GAHE=; h=From:To:Cc:Subject:Date; b=rx4ykTJ6CnQ8aiS9/VY7PU0mBKR/mRJ1mhqdYbBlA9YI8mM9rK3+ZCenaCyWoaNsE Z3UMLlZoSRo2dFVZWfzKuU0WrhfX+k8XikdQ+VQnlPqI/hus9WzTrxcwdjRzjwI2iN ha5olxDqPTDlqHdnECJGd/XuLWuk/WWc1KRmym4b7XQakdGrKqXRzHH4jdG8MMQbd/ 1X3/i+2Xt6nHhi5REkkYWaJKtW1+YZ2wwvXXHO3sQ+E5dIRkpeFSbIRDuULSbo03uN nucZmyyyGzqTOik/a0M38rXnk56MIbc9bjWczMwLo7T4QxHFWLszksPtesOJa2igmp Am5Yeq9L6AIQg== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 08 Jun 2023 21:11:47 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Patrice Chotard , Alessandro Zummo , Alexandre Belloni , Lee Jones Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-arm-kernel@lists.infradead.org, linux-rtc@vger.kernel.org Subject: [PATCH 1/2] rtc: st-lpc: Release some resources in st_rtc_probe() in case of error Date: Thu, 8 Jun 2023 21:11:42 +0200 Message-Id: <866af6adbc7454a7b4505eb6c28fbdc86ccff39e.1686251455.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 If an error occurs after clk_get(), the corresponding resources should be released. Use devm_clk_get() to fix it. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Christophe JAILLET --- drivers/rtc/rtc-st-lpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index 0f8e4231098e..d04d46f9cc65 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -228,7 +228,7 @@ static int st_rtc_probe(struct platform_device *pdev) enable_irq_wake(rtc->irq); disable_irq(rtc->irq); - rtc->clk = clk_get(&pdev->dev, NULL); + rtc->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(rtc->clk)) { dev_err(&pdev->dev, "Unable to request clock\n"); return PTR_ERR(rtc->clk); -- 2.34.1