From patchwork Tue Jun 6 08:15:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13268695 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 7D5D5C7EE24 for ; Tue, 6 Jun 2023 08:19:16 +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:Subject:Cc:To: Date: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=fPoIBFK+AuHNX2rI1mc+9uqgnoCqPXWq6QPqPxtvJm4=; b=N5qEF2goAbJUA8 ucKOm7hTqF6bxUBIpcs5C+9dH/RnoCzt+hOw23wsG5zJV+3OLJZSvP+VRAg1lNZNEMaA1pS1lovK/ V91tioqMx3xlg9KuqcyPmF0zC85jT559ORHU5WICfBpHat/LJNhPqbF6dNtdxCyUXA6ieZvrAspV4 usMIM69GnZiua+2jFo+yn+tFNqPrZmwDtRVnkgs+JBmy2oq4oSfSPiCM0o5JetJKEYLc1QsiTsw6X qWXx3O9jFffh6hHbztAtZpTcZv6p1t0KjriCAE8lcpMXTIhwBIah8tqWDWZsdJCwDQhTa1z6gKAAq q/6a/Gu4z+UTXjNQqanA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q6Rtx-000lWD-1J; Tue, 06 Jun 2023 08:18:49 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q6Rtu-000lVH-2p for linux-arm-kernel@lists.infradead.org; Tue, 06 Jun 2023 08:18:48 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-30ad99fa586so5722288f8f.2 for ; Tue, 06 Jun 2023 01:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1686039524; x=1688631524; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :from:to:cc:subject:date:message-id:reply-to; bh=r1ogFYOCyCFggyVGMppR34+8UlfrkJd0gNAyYus2c7g=; b=GaG1+A/1fqB4K0sbQ53AXMdJkSekcvvdxU93FR0Sl4ZGcV9BC4YC12z984o5xqeIg5 wph71hndT/zbGpnrzvhxtJF+EGGdYGwnJ2xPdlRWVAs/rYBKj+97rqjEhYmGkQO9MKJk seJY5gu0yPutMel+ZkqF+QmP4JdVFKcwrLdRkn+CipWJpfwAP9siotUlyUwgSJaXnZoA x6ut+oNptwIz5G6D77TRLkYrrly8eFrnTyzTrdGVTD3u3XfH9U5lwRCzDzvbXcGxkk5P 5KqHgpiSgdUJPCRWP5NaGPOO134PrNqn//fEebmipori8S8WYYue8qHd2zUpbw3i4Oa+ vzhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686039524; x=1688631524; h=content-disposition:mime-version:message-id:subject:cc:to:date:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=r1ogFYOCyCFggyVGMppR34+8UlfrkJd0gNAyYus2c7g=; b=hVNAkX5mNXk6VDruc+Qg71ORS+r1+k5Dnoa1cAwPmx1MnVZRVD2Y4vlHEmnOCXUtUY JRV5kNGBexySXfgsAHdcPobes+GL4AlMNqbmWoMnom7U5dc+R0ek/SZoI2xNwjrgBqdV z+yPf1RwTfNcCQhG1OazFnQfDIjV58vF8ZQOtN12yP5cNLSYHjWw5EpS9I7S/oXNiRqx WRsyk5p8u2Y+PQtMb8wMneAtOoxxACRiBi6FtRbpdBLm2IjzYveMouc3ZbHf77AmXTaC MeAscAqbEeDaH1lXH1miA2RAMCx+lN5jKX4UKvrumukN8vcXwh7QKV1hB37VxQXwx1Hs KGbw== X-Gm-Message-State: AC+VfDwtyk2tCOAHjTVIPg8NsHQ9w6Lu8y0HjZXdivbf0M35LQBPyGn9 DIeu+/2SngauR990AHieA8meXQ== X-Google-Smtp-Source: ACHHUZ4co9T62EMNnO0BuoPuXsJlGg091sebkcpWwQ08ejOZgq+8Q/rhKN06jYlX3r6Sqsuq8KBhaA== X-Received: by 2002:a5d:40cd:0:b0:30a:eac4:26a0 with SMTP id b13-20020a5d40cd000000b0030aeac426a0mr1150739wrq.18.1686039524012; Tue, 06 Jun 2023 01:18:44 -0700 (PDT) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id m25-20020a7bca59000000b003f7e62d38d4sm4263267wml.25.2023.06.06.01.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Jun 2023 01:18:42 -0700 (PDT) From: Dan Carpenter X-Google-Original-From: Dan Carpenter Date: Tue, 6 Jun 2023 11:15:46 +0300 To: Michal Simek Cc: Daniel Lezcano , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] clocksource/drivers/timer-cadence-ttc: fix a signedness bug in probe() Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230606_011846_916575_8CDBFF46 X-CRM114-Status: GOOD ( 14.51 ) 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 Make the "irq" variable signed so the error handling can work. Fixes: e932900a3279 ("arm: zynq: Use standard timer binding") Signed-off-by: Dan Carpenter --- From static analysis. Untested. Presumably if probe fails the system is unbootable so I didn't bother looking at the resource leaks. drivers/clocksource/timer-cadence-ttc.c:377 ttc_setup_clocksource() warn: 'clk' from clk_prepare_enable() not released on lines: 370. drivers/clocksource/timer-cadence-ttc.c:466 ttc_setup_clockevent() warn: 'clk' from clk_prepare_enable() not released on lines: 466. drivers/clocksource/timer-cadence-ttc.c:529 ttc_timer_probe() warn: 'irq' from irq_of_parse_and_map() not released on lines: 508,516,521,525. drivers/clocksource/timer-cadence-ttc.c:529 ttc_timer_probe() warn: 'timer_baseaddr' from of_iomap() not released on lines: 498,508,516,521,525. --- drivers/clocksource/timer-cadence-ttc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c index 4efd0cf3b602d..8ba1f5c2d7992 100644 --- a/drivers/clocksource/timer-cadence-ttc.c +++ b/drivers/clocksource/timer-cadence-ttc.c @@ -468,13 +468,13 @@ static int __init ttc_setup_clockevent(struct clk *clk, static int __init ttc_timer_probe(struct platform_device *pdev) { - unsigned int irq; void __iomem *timer_baseaddr; struct clk *clk_cs, *clk_ce; static int initialized; int clksel, ret; u32 timer_width = 16; struct device_node *timer = pdev->dev.of_node; + int irq; if (initialized) return 0;