From nobody Fri Oct 24 20:51:22 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6621FC00140 for ; Mon, 15 Aug 2022 22:49:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351859AbiHOWta (ORCPT ); Mon, 15 Aug 2022 18:49:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351978AbiHOWr3 (ORCPT ); Mon, 15 Aug 2022 18:47:29 -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 94C2A7CA99; Mon, 15 Aug 2022 12:53:11 -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 EEC3D6122B; Mon, 15 Aug 2022 19:53:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DCAAFC43140; Mon, 15 Aug 2022 19:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593190; bh=UkexD9rfgmwaolcR9QQUHVrlFEriZt7CFdO7HMCyRRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l/cWFyzIb1MB447S3abr/n3ZlQvoXCGsYUljIcwd8uZUp7G9xY65wrEJJ11SL5D77 FMy5iSgwCZHXb6bC2p3sFypJiYy+9LAOEx3R7oJVk/xT1CaGDT3yCS8Qt28xBjy0r3 bKqK+Y1UutYJdpzzsDPavJAb1r3CO7z3mPM+7Afo= 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.18 0909/1095] watchdog: sp5100_tco: Fix a memory leak of EFCH MMIO resource Date: Mon, 15 Aug 2022 20:05:08 +0200 Message-Id: <20220815180506.896913248@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 M= MIO") 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 *d= ev, iounmap(addr); =20 release_resource(res); + kfree(res); =20 return ret; } --=20 2.35.1