Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3024057rwb; Mon, 15 Aug 2022 16:21:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR7PczupgNSvPRIspTplf+g8SQLcSSTGecinCbZ6tgjYgyLvzcjmkZ4xD/JXB3ROc5HKhzsu X-Received: by 2002:a17:903:120c:b0:172:728a:3b24 with SMTP id l12-20020a170903120c00b00172728a3b24mr5381781plh.61.1660605610339; Mon, 15 Aug 2022 16:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605610; cv=none; d=google.com; s=arc-20160816; b=j1ZaO5e05u7FhQNJ0l4Wri5tXZj0M5N4Pdb9EUPHainXMmz7K4x/87aO99spfvxU3l CAsdQiIKWsb7XgEzPb2IE89UeXnjZXwPq/oxvpGxcuQOMZhmOFN70sLu/f1jxLbXYF/L 9VqiD8E4gDhu0hQLTlTH2ap8pPOqoq3e8/zz16rVnu8V35AAhN3fNCsHmfdoQa0E/f0z YCZizGghTJS4k12RWbhPUPhbji2q8R4W+Ww4voP9p2vI3XM7lbgwetIHGaITpm0CQ9zQ iBxNehhkqYqkXshDdHkKDNZD/u5XYb5pAUZrOPSuFQHOVSnhu09n4WT0KW69/qOXJJl0 WhWw== 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=trr4H+x9lCWhqdht6WBJV30YG09a7RvfVFNO8u108OFoRr5ZjVnDKhgfuaMhWwOku+ Q7DlBuOEDS0yp3OxBzLiGjCrMFdH8duprBvcR7d5OuGkVo1WJRhdcxgA2n2rdBatgroZ 1oAQdjQ13RHDs3RrGCGpif91d2uy9i523Q9V+t03sD0hJNxAMv/+f8oPCtfkShwtPziA hO3klXcAOYVUYmCNPIgUSFG7huqu5SObG1Yp0R3ACE9r8xGoR19eYzb2v2B7SXPtsnkV RaHsR8h+6lHvMoRas2WKQrm2vjV/F+F5utc8xvdHz+miLc+UuQ/k/hbJA1py2peQ/C+j 8vFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="l/cWFyzI"; 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 d1-20020a170903230100b0016dbc1b5b31si13555573plh.61.2022.08.15.16.19.56; Mon, 15 Aug 2022 16:20:10 -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="l/cWFyzI"; 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 S1351816AbiHOWt2 (ORCPT + 99 others); Mon, 15 Aug 2022 18:49:28 -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-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