This is a note to let you know that I've just added the patch titled mmc: core: Prevent bus reference leak in mmc_blk_init() to the 4.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mmc-core-prevent-bus-reference-leak-in-mmc_blk_init.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From d0a0852b9f81cf5f793bf2eae7336ed40a1a1815 Mon Sep 17 00:00:00 2001 From: Alexander Kappner <agk@xxxxxxxxxxx> Date: Wed, 28 Mar 2018 15:18:31 -0700 Subject: mmc: core: Prevent bus reference leak in mmc_blk_init() From: Alexander Kappner <agk@xxxxxxxxxxx> commit d0a0852b9f81cf5f793bf2eae7336ed40a1a1815 upstream. Upon module load, mmc_block allocates a bus with bus_registeri() in mmc_blk_init(). This reference never gets freed during module unload, which leads to subsequent re-insertions of the module fails and a WARN() splat is triggered. Fix the bug by dropping the reference for the bus in mmc_blk_exit(). Signed-off-by: Alexander Kappner <agk@xxxxxxxxxxx> Fixes: 97548575bef3 ("mmc: block: Convert RPMB to a character device") Cc: <stable@xxxxxxxxxxxxxxx> Reviewed-by: Shawn Lin <shawn.lin@xxxxxxxxxxxxxx> Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx> Cc: Jisheng Zhang <Jisheng.Zhang@xxxxxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/mmc/core/block.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/mmc/core/block.c +++ b/drivers/mmc/core/block.c @@ -2904,6 +2904,7 @@ static void __exit mmc_blk_exit(void) mmc_unregister_driver(&mmc_driver); unregister_blkdev(MMC_BLOCK_MAJOR, "mmc"); unregister_chrdev_region(mmc_rpmb_devt, MAX_DEVICES); + bus_unregister(&mmc_rpmb_bus_type); } module_init(mmc_blk_init); Patches currently in stable-queue which might be from agk@xxxxxxxxxxx are queue-4.14/mmc-core-prevent-bus-reference-leak-in-mmc_blk_init.patch