From patchwork Sun Aug 25 18:31:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 13776870 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 405ADC5320E for ; Sun, 25 Aug 2024 18:32:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=w81sNAjj7bntfbvuI21+JZjX/UT6h5yzbhiBUj0PJK4=; b=lpO/ywUOgzjkhwO3TFJQR0Crog uaLmXJpQlCN5CsdVcUBrzQcCH0YnJHvb50Gkq7+H6oSCjO01Ab1uVO/2R0ePKEvvD+HDu7rx4nzsn eiVFdl57O9u9vTrl2w5q4YwQoR38RhjsECyrfl76Q1T2FvF/Hi7Hgi8Sa1ei1GyLAA20nQ7odO/2z oEwUHiOQ7+UuKO98Xb/ggbK6/wXRD0Wv+KCixlFO9l9aQeDCClMK01QJ6iKu5qu/EnGtdzWiLq6L9 BG5pgks+mEMZ2ErTJoaI2UIiCG7uXiIriNiFNxIaTIIerB2QlDlEFlyQVYvYQGcxbAgMqyWICKzVz l5Exxy8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1siI1t-00000004oZT-03vb; Sun, 25 Aug 2024 18:31:57 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1siI15-00000004oPy-2FGJ for linux-arm-kernel@lists.infradead.org; Sun, 25 Aug 2024 18:31:09 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-4280772333eso5614115e9.0 for ; Sun, 25 Aug 2024 11:31:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724610666; x=1725215466; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=w81sNAjj7bntfbvuI21+JZjX/UT6h5yzbhiBUj0PJK4=; b=bLbc/EiSYsYyBT9lygPfrQcXXO8I4TbB/8sBbEHTQnTBEX45n7+AmMPQayC5WCLnHm nhidCvlNhdMNdJRBDiki3brIlv6rxCpbmvo2cXPivWzhZHUmZhqbK4umrdtQHFy9hfy+ kHMIkpIlU5lxjXf0M+9QMzpY3ffN4JmCLKXZ/oqWLQXuu3GnYWaYHRuF4uLEUc7z2hiT OEjIm6BEZhR/qlQHNuAiwmrzg3JPt28sYJFVnUFpdxEcEd1c1QFXYk+Kdq8/ib9nnSrQ qro51WTw3iYAdv8rh1xFt4f+z0c4uD3270jW8vfrj9dU5fd4aotuzblYsX05Zhm5EoKO wzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724610666; x=1725215466; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w81sNAjj7bntfbvuI21+JZjX/UT6h5yzbhiBUj0PJK4=; b=mnuqny3Gm/igkObDnwAvZkfIQCVz4rBEf1+s5ZsSjm3pbNmJEMMvsOFMaH5XOXEE+j tWlrpncWGF8WjaOdE1xIvds8gmEz3aE/PSfpCG+Yw6BBt6FzLAckRqZN9GU98fa9U/F3 RBAgbe8PuBZZXtb5FWaSbcjUFjM+bBHFG9jwSL412tYZPB9bCM4Fe5gFq6FOeYJRWR92 2hmfZ+dTY+d6vTPZOGlCjkzM9EZYqY/KjomBiuI8meV7B26iYIEE8pP9+7O9Hv78cCvC GGTH5WcIPCgmq498MWJCi2eYEKC5Ve238OuNW7amDfrwXNiUlEm1T95xp4U0h1EJJi/+ VqEg== X-Forwarded-Encrypted: i=1; AJvYcCXjFmNTLgsELpGldE9ne2g7aKK5gAOeHH/AuAbNRGoDlMWxV5g08h/cfR9B5iYfNQeBYlYHMRTu+nub00pmtWKE@lists.infradead.org X-Gm-Message-State: AOJu0YyG27gMEOVpZ9Dg/2bC9qMVOp4f854dTOClHhjsBXXkPsICzkD0 Sw/cafQYi9yZ+MnEQw6JgOoPTBHlTRk/tBIn90WaNu6tF67uY3o1VKpXNZiJFLM= X-Google-Smtp-Source: AGHT+IFejGAuvYGwHP2LF9xrcXSzDcVV088gMtM4kujRFSeLgJtQZGFe1VXGPMy0SKXdemyo6Zw+ww== X-Received: by 2002:a5d:6481:0:b0:360:872b:7e03 with SMTP id ffacd0b85a97d-373117ba829mr3215443f8f.0.1724610665912; Sun, 25 Aug 2024 11:31:05 -0700 (PDT) Received: from krzk-bin.. ([178.197.222.82]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37308141dc3sm9034183f8f.41.2024.08.25.11.31.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Aug 2024 11:31:05 -0700 (PDT) From: Krzysztof Kozlowski To: Alexandre Belloni , Nicolas Ferre , Claudiu Beznea , Boris Brezillon , Johan Hovold , Arnd Bergmann , linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski , stable@vger.kernel.org Subject: [PATCH] rtc: at91sam9: fix OF node leak in probe() error path Date: Sun, 25 Aug 2024 20:31:03 +0200 Message-ID: <20240825183103.102904-1-krzysztof.kozlowski@linaro.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-20240825_113107_619357_62137600 X-CRM114-Status: GOOD ( 10.76 ) 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 Driver is leaking an OF node reference obtained from of_parse_phandle_with_fixed_args(). Fixes: 43e112bb3dea ("rtc: at91sam9: make use of syscon/regmap to access GPBR registers") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/rtc/rtc-at91sam9.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c index f93bee96e362..993c0878fb66 100644 --- a/drivers/rtc/rtc-at91sam9.c +++ b/drivers/rtc/rtc-at91sam9.c @@ -368,6 +368,7 @@ static int at91_rtc_probe(struct platform_device *pdev) return ret; rtc->gpbr = syscon_node_to_regmap(args.np); + of_node_put(args.np); rtc->gpbr_offset = args.args[0]; if (IS_ERR(rtc->gpbr)) { dev_err(&pdev->dev, "failed to retrieve gpbr regmap, aborting.\n");