]> git.baikalelectronics.ru Git - kernel.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)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 17 Oct 2022 09:51:34 +0000 (11:51 +0200)
commitc250733591a18d478c8794d84fbd6e77832564f7
tree6253fed96b23b2461ce787e44051de217b049249
parent89970e41ffe50168a2b6dc2c0df01fd57649bd0a
mmc: core: Fix kernel panic when remove non-standard SDIO card

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: 7c1960a0e5ff ("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>
drivers/mmc/core/sdio_bus.c