mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
mmc: core: Fix kernel panic when remove non-standard SDIO card
commit9972e6b404upstream. 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:6f51be3d37("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> Change-Id: I4b180f3e2247639b025462a72a41fa7a3df5232e
This commit is contained in:
@@ -272,7 +272,7 @@ static void sdio_release_func(struct device *dev)
|
||||
* If this device is embedded then we never allocated
|
||||
* cis tables for this func
|
||||
*/
|
||||
if (!func->card->host->embedded_sdio_data.funcs)
|
||||
if (!(func->card->quirks & MMC_QUIRK_NONSTD_SDIO))
|
||||
#endif
|
||||
sdio_free_func_cis(func);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user