From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D78D714373E; Wed, 19 Jun 2024 13:28:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718803698; cv=none; b=EhX8HLaIV2lrFe1h9dQkeLconOLj2q7RCELZt9SpBUa65GrJ5htCRNRV5l+Bp9oca2CvUYVtL0ggND+NV2B+QuZTPYe89KIBra6U6O1NGrbWR4EN/G5j+3duadKJAAlnvD0DqfyPHvNLwLFtT9TXVnjHiSkmZXMNLEiKHrqBzjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718803698; c=relaxed/simple; bh=o1PYL/ms42babaE4luvdeYXOL9Dmew5RvOoSxW13Dvo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=rGCOPASsqhsQafV+CuZDDsaAnGMv6UTGAiitaTzDqm6/ac8brQ5ckDKSoz6w/AJqtK820gxYvlKQIEdXXvAL5LqKpCsjMEmpGQ1m7iXFpD6JpF6pa9g72zLUtDDWKIrP+oA9/vOJw+Hx/A1022mZPnsC9+gkXElbMEBEFCB378M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1fFupJ0n; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1fFupJ0n" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CD4FC2BBFC; Wed, 19 Jun 2024 13:28:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718803698; bh=o1PYL/ms42babaE4luvdeYXOL9Dmew5RvOoSxW13Dvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1fFupJ0n9/P5dquMhnw5yDVUNNsntRp2kBxOpSEIiyzo/WxmVt1VbUNGABD46em75 D9xhVgKQKvOjrrAPENstv6qOBfAZm9fklxN4+TVIoGQWTlRh9eN+zmSqXVwKgUqVEa ZtvNfa12zErAop+7QpxXjIa30jPsX01jiDzTlb10= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Ulf Hansson , Sasha Levin Subject: [PATCH 6.1 066/217] mmc: davinci: Dont strip remove function when driver is builtin Date: Wed, 19 Jun 2024 14:55:09 +0200 Message-ID: <20240619125559.231909177@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240619125556.491243678@linuxfoundation.org> References: <20240619125556.491243678@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Uwe Kleine-König [ Upstream commit 55c421b364482b61c4c45313a535e61ed5ae4ea3 ] Using __exit for the remove function results in the remove callback being discarded with CONFIG_MMC_DAVINCI=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally. This also fixes a W=1 modpost warning: WARNING: modpost: drivers/mmc/host/davinci_mmc: section mismatch in reference: davinci_mmcsd_driver+0x10 (section: .data) -> davinci_mmcsd_remove (section: .exit.text) Fixes: b4cff4549b7a ("DaVinci: MMC: MMC/SD controller driver for DaVinci family") Signed-off-by: Uwe Kleine-König Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20240324114017.231936-2-u.kleine-koenig@pengutronix.de Signed-off-by: Ulf Hansson Signed-off-by: Sasha Levin --- drivers/mmc/host/davinci_mmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index 7138dfa065bfa..e89a97b415154 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c @@ -1345,7 +1345,7 @@ static int davinci_mmcsd_probe(struct platform_device *pdev) return ret; } -static int __exit davinci_mmcsd_remove(struct platform_device *pdev) +static int davinci_mmcsd_remove(struct platform_device *pdev) { struct mmc_davinci_host *host = platform_get_drvdata(pdev); @@ -1402,7 +1402,7 @@ static struct platform_driver davinci_mmcsd_driver = { .of_match_table = davinci_mmc_dt_ids, }, .probe = davinci_mmcsd_probe, - .remove = __exit_p(davinci_mmcsd_remove), + .remove = davinci_mmcsd_remove, .id_table = davinci_mmc_devtype, }; -- 2.43.0