From patchwork Fri Dec 22 10:46:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 13503196 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 78DE0C41535 for ; Fri, 22 Dec 2023 10:47:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=9pjcKRxF7uMNo6FhE6eSSbX8IYcKeZekyTNn5zoTkAo=; b=z3OBzi0qD0Dd4H 5j4NlNFw//9VCvK+MHmQONPEaiIHXuWvMA8iRTmJnzRPFRmjwv8cZKJ7yUm2AS27YL7qTydRbdw9f B9ItMxvJ4ev/8FQwWVJmUeim0dVG30HletR9gfsgHmrNEesEGuWtx932AGb6Z4VBPOWiLcsuvkNxn Yu/8SEE5meGYe/vhLJnUS7IsPBVkF/fU9Qx8ljanFbzDADhWzrqM5+PpsBgXMJWfaQpj7+APOSe6y qI8oYJuK9G3sNilF0QD0pCLEgJBmRUWeqfQjtX+e0zSOect3EU8125sz68wwMVty0qrOdjdHXI0qr b+sPScOlfieiK1TLWYpA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGd3b-005aNV-14; Fri, 22 Dec 2023 10:47:07 +0000 Received: from gofer.mess.org ([88.97.38.141]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGd3Y-005aMn-1b; Fri, 22 Dec 2023 10:47:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mess.org; s=2020; t=1703242022; bh=S3TdkYP2WghBFHy35jL/ROGvth6643mc86CxxDgb1U8=; h=From:To:Cc:Subject:Date:From; b=gUYtg5ezYM/EDbHPORtrNN/YV8JN1bOp0LRLqBB4o30HDCSmlbO/v5/facSgYfSei g+QSg3pC5H4vMtLun/ys70hpuyi6J6s2M1yC4be68spoquTOUfz9msSSwTiec8cIyY mY24+1pHHmuEiwDB01Lb08zQ/3Zq6b8vd6cOogrrtoWpdzBnbLYSkKgOkXzTaM+gx5 ceAXfA025J+LmsCT9QxNt5G5RZIx3nUyCdmSlznD3x2CQtuG967baUeS5P1NOxOKkz OLr4nGiUmjDgpWuyYbVv4EJOd9eO3BcmaKnTg2y+1NDAovuYpFzn4oa0uynOaJrhCv VlLxmL5giYa1g== Received: by gofer.mess.org (Postfix, from userid 501) id 69D2B1009FD; Fri, 22 Dec 2023 10:47:02 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mess.org; s=2020; t=1703242019; bh=S3TdkYP2WghBFHy35jL/ROGvth6643mc86CxxDgb1U8=; h=From:To:Cc:Subject:Date:From; b=fo8v5dvSUCgr8MIUEOxgdZZeY146rwQuo9A8VEI4kkJCThHrjjsN/3OROrZnDrsEz jxqjs8Tmc1fcYma2x+rAAKUmvMQowixuUVuQoUEC4nL+95fVw5jyMvabXmji1mUtqn Z6ENDQUsCF7XGNZXaVKNzHKcjCoXflFdR5nzywpo4zB9T0PUka+6SB0hLi2KvtAE6h GhS8hmA9Iy28/tDj8nM3ivCyLgjW9Z2hLOqIxn3SMccgWnmQSz07VgUQSZo2hE6O3K i/entkExxaVWEP60GtBZK+pYRiTxU0QK9gcMCxAQOl/fjpnkiDJrOK/qj0jTBneegu mfzJxGUDy4/gg== Received: from localhost.localdomain (bigcore.local [IPv6:2a02:8011:d000:212:ca7f:54ff:fe51:14d6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by gofer.mess.org (Postfix) with ESMTPSA id CDA5C1000CC; Fri, 22 Dec 2023 10:46:59 +0000 (GMT) From: Sean Young To: Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6n?= =?utf-8?q?ig?= , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden Cc: Sean Young , linux-pwm@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] pwm: bcm2835: Duplicate call to clk_rate_exclusive_put in error path Date: Fri, 22 Dec 2023 10:46:51 +0000 Message-ID: <20231222104651.167821-1-sean@mess.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231222_024704_677043_D5F71A61 X-CRM114-Status: GOOD ( 11.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org devm_add_action_or_reset() already calls the action in the error case. Reported-by: Uwe Kleine-König Closes: https://lore.kernel.org/linux-pwm/fuku3b5ur6y4k4refd3vmeoenzjo6mwe3b3gtel34rhhhtvnsa@w4uktgbqsc3w/ Signed-off-by: Sean Young Reviewed-by: Uwe Kleine-König --- drivers/pwm/pwm-bcm2835.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-bcm2835.c b/drivers/pwm/pwm-bcm2835.c index 307c0bd5f885..283cf27f25ba 100644 --- a/drivers/pwm/pwm-bcm2835.c +++ b/drivers/pwm/pwm-bcm2835.c @@ -160,10 +160,8 @@ static int bcm2835_pwm_probe(struct platform_device *pdev) ret = devm_add_action_or_reset(&pdev->dev, devm_clk_rate_exclusive_put, pc->clk); - if (ret) { - clk_rate_exclusive_put(pc->clk); + if (ret) return ret; - } pc->rate = clk_get_rate(pc->clk); if (!pc->rate)