Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2873949rwb; Mon, 15 Aug 2022 13:04:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR57HEPI2gsfA4DQDS/ENohTcCBxRP0+KvE/ajKVFdfwV1z4eaz6Fy7Il9LHwNI+frRWfSe9 X-Received: by 2002:a05:6402:f22:b0:43e:8623:d32c with SMTP id i34-20020a0564020f2200b0043e8623d32cmr16076685eda.265.1660593876966; Mon, 15 Aug 2022 13:04:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660593876; cv=none; d=google.com; s=arc-20160816; b=qniKRD12mGBVj67yhjhub4vUwG+RJnhJNsa5go6NGRIx9tXbyEA5TF44cSTWjfpGP8 CUzznUeZffAPtB0Qy1QWf7fev+juchJCSSh9tTkM9KwFWlM/Sx59pfAm7NPPX234czpU 0Gdw6eGpVe2CYz/e9lveMyCu3IDAYDsF60Gk5u1IRn+LtUND7u0RJQft+CvCo9+hKtEu kF3U9eKzjWc5jY0H3lpBRuBcMaYp0QqbB3TucTPHcd4HoOpCVzwW7mIOzSXHuY8Sk6vL RMVg/NlSDem1lzdlz5/hQBLaRl1oiEuTv7SH811dku4fwxrGqxxCzixzi6HxvM+JCGwj DvZg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dWD00AjMbAHzyj0xC6rqwOj5aI+3PZCvWJnkSEqYOWc=; b=G4E641IVz1J2zS9dML3DtEpMOZqNOFB2B8N8SW81phBnEdv8+E3BPSliuvdYlZsezu 1DfFTA/pLhHW10pxT3yEwjmwQzJqDlT+t4WLGgWSB1tRZ/jSFzR9yFNdZGl6TGaumnig tyQCj3X+nQsdBg8nslahZNPyVtPor4DTsL3zgJp90GImJCdb+yAutQJvtcO8mdnBF7Ir scRivgbafa1A/lEhSfxYlrN4Cup1MqgQw3Qe8m9giyq0Og/QETeKB7a6Yek+QT/fhpPG vAeWIX2G9NYDEM3BHpUOIMdDux3RD2edoZP+N6b5HFxSyDqqZYpFUy4Vd/ZhzlSPsjhq 1cCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1AOwlyLL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w25-20020a170906b19900b0072b11a2a2afsi7660752ejy.57.2022.08.15.13.04.09; Mon, 15 Aug 2022 13:04:36 -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=@linuxfoundation.org header.s=korg header.b=1AOwlyLL; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344810AbiHOToz (ORCPT + 99 others); Mon, 15 Aug 2022 15:44:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344870AbiHOTlq (ORCPT ); Mon, 15 Aug 2022 15:41:46 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9430C66A4C; Mon, 15 Aug 2022 11:47:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B17BA611EA; Mon, 15 Aug 2022 18:47:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB273C433C1; Mon, 15 Aug 2022 18:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660589256; bh=UBA+AIG0oDv9VnGsMs56izD1WNgmZUuKglNygKzGjco=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1AOwlyLLbb+U/zo1k6hlwb+r3cUb4o7LILi92rIpIAADzlPx46WUrwj2fh7bgoRmu sF513pwvJKIOIWgZjsFdtKaSalyBkxmHtyeatmNa52aDcjkpO64ls7ns+FjjTX+siS +0Mtd+zYzVbBprwmzfQiOi6ONZbmPt68NN++VV64= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jean Delvare , Terry Bowman , Wim Van Sebroeck , Guenter Roeck , Sasha Levin Subject: [PATCH 5.15 630/779] watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource Date: Mon, 15 Aug 2022 20:04:34 +0200 Message-Id: <20220815180404.283750714@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 From: Jean Delvare [ Upstream commit c6d9c0798ed366a09a9e53d71edcd2266e34a6eb ] Unlike release_mem_region(), a call to release_resource() does not free the resource, so it has to be freed explicitly to avoid a memory leak. Signed-off-by: Jean Delvare Fixes: 0578fff4aae5 ("Watchdog: sp5100_tco: Add initialization using EFCH MMIO") Cc: Terry Bowman Cc: Wim Van Sebroeck Cc: Guenter Roeck Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20220621152840.420a0f4c@endymion.delvare Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/sp5100_tco.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/watchdog/sp5100_tco.c b/drivers/watchdog/sp5100_tco.c index 4820af929a82..4afc468d8ed1 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -394,6 +394,7 @@ static int sp5100_tco_setupdevice_mmio(struct device *dev, iounmap(addr); release_resource(res); + kfree(res); return ret; } -- 2.35.1