]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mmc: core: Fix kernel panic when remove non-standard SDIO card
authorMatthew Ma <mahongwei@zeku.com>
Fri, 14 Oct 2022 03:49:51 +0000 (11:49 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:49:16 +0000 (23:49 +0900)
commitb8b2965932e702b21e335ff30e1bb550f5a23b6f
tree31c4792fcd67ffb1ea1d0769dab03fdfb878c4ce
parenta9c1a6991a9b5aa6d0f2cbc9b8c3bf6c4d094dfa
mmc: core: Fix kernel panic when remove non-standard SDIO card

commit 9972e6b404884adae9eec7463e30d9b3c9a70b18 upstream.

SDIO tuple is only allocated for standard SDIO card, especially it causes
memory corruption issues when the non-standard SDIO card has removed, which
is because the card device's reference counter does not increase for it at
sdio_init_func(), but all SDIO card device reference counter gets decreased
at sdio_release_func().

Fixes: 6f51be3d37df ("sdio: allow non-standard SDIO cards")
Signed-off-by: Matthew Ma <mahongwei@zeku.com>
Reviewed-by: Weizhao Ouyang <ouyangweizhao@zeku.com>
Reviewed-by: John Wang <wangdayu@zeku.com>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20221014034951.2300386-1-ouyangweizhao@zeku.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/core/sdio_bus.c