Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3262579rwb; Mon, 15 Aug 2022 22:38:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR4fVzhrxPORt0rYGsT+pTRHZKJmqR9hKCCaYffLaB0rXTQCs78dZkjvfJyGfWO3+mdYlJEA X-Received: by 2002:a05:6402:241d:b0:443:39c5:808b with SMTP id t29-20020a056402241d00b0044339c5808bmr16468873eda.39.1660628306763; Mon, 15 Aug 2022 22:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660628306; cv=none; d=google.com; s=arc-20160816; b=vU6OkZlKCdHdv7DYNgE/0CXqh2W45AQFI5l071XZdruNHQX5hgmVYcukE2G/iSvXOz QQ/pSOKsW4uPb5yQvpy7r1huT0Rs6l4u2YU21mWYIOSSoECY/0KxNfZSzJShvDJz/sDM qNLHDUpwCPMRdvdQIH3bISCiAu9Z6TRAPrhwZM5m8V8eHblR3PnVSszTTkojxXvy/owo HQ/wci9BWJeZSOMZam6UeKWDWqAOeHiGxVxuctaxQX8jqgcvaInu8UlRROQ/3WF0agy4 kh32EmD3AMmSqgRrVntdyJlj78SCO4Sn/B83tnYTTvW7ZSzmBVOa5bzrX+szwzGSaQfG 7Byw== 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=nKkXzf4/HfL8L3ahk9cD2THCEeF7XHbqzi/47GVU6yM=; b=A3qAdirj63RILMNKRo2yxoOTJdJu8CSUm3X9DVk6FW4VNzTNWICmiTnQq3R6j3AZmD +UB+xjZ+EGJfRXflEGPJXSIU2PlMKnIWKGZ1nHv7gUZFl4/nwdMdb5UPRXL7NNa0slxD bYMYXfnspyM1yKvDESwrZJmCB6F2V4v+M2Gk71EZVv4KS4hfCQiUSl43NY1TjY86Zz8Z SLFMWBP2OyWgovXsOKrbJNrY9DQqGJlUC1AZIBuYuC16npea8e/bZVhp9SdMRmAkSN/E 3wTGthB7yB/0uC7lzB4qmHTdn0SEYkCria3+0QoQjWKBFaqe2c89kaRqA+K3k1jWugn8 fdqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YZeVBCQ3; 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 di3-20020a170906730300b0072af8809a85si9613664ejc.332.2022.08.15.22.38.01; Mon, 15 Aug 2022 22:38:26 -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=YZeVBCQ3; 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 S232036AbiHPEsr (ORCPT + 99 others); Tue, 16 Aug 2022 00:48:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232611AbiHPEpn (ORCPT ); Tue, 16 Aug 2022 00:45:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 347A0A063E; Mon, 15 Aug 2022 13:42:24 -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 C795E61233; Mon, 15 Aug 2022 20:42:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 981C9C433D6; Mon, 15 Aug 2022 20:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596143; bh=UkexD9rfgmwaolcR9QQUHVrlFEriZt7CFdO7HMCyRRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YZeVBCQ3b8u7j7IRbu60eHabLxBad6vNzHm9CYUuqS5/9k5ct6gtzD4940UnIYK2p YI4gH4RWcxWZrbNOdL2fp5q70+MWyAMoIMsdtjOFq7/YwCu7LaRWpqfZGeukLlGoo4 SjbR8KKAxwJDI4ScrauWAbmjTo735AlJeujmY7IE= 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.19 0987/1157] watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource Date: Mon, 15 Aug 2022 20:05:43 +0200 Message-Id: <20220815180519.221704518@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 86ffb58fbc85..ae54dd33e233 100644 --- a/drivers/watchdog/sp5100_tco.c +++ b/drivers/watchdog/sp5100_tco.c @@ -402,6 +402,7 @@ static int sp5100_tco_setupdevice_mmio(struct device *dev, iounmap(addr); release_resource(res); + kfree(res); return ret; } -- 2.35.1