• Geert Uytterhoeven's avatar
    mmc: tmio: Remove bogus un-initialization in tmio_mmc_host_free() · 7df0c5a4
    Geert Uytterhoeven authored
    commit 13a6a2ed upstream.
    
    If CONFIG_DEBUG_SLAB=y:
    
        sh_mobile_sdhi ee100000.sd: Got CD GPIO
        sh_mobile_sdhi ee100000.sd: Got WP GPIO
        platform ee100000.sd: Driver sh_mobile_sdhi requests probe deferral
        ...
        Slab corruption (Not tainted): kmalloc-1024 start=ed8b3c00, len=1024
        2d0: 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  ....kkkkkkkkkkkk
        Prev obj: start=ed8b3800, len=1024
        000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
        010: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b  kkkkkkkkkkkkkkkk
    
    Struct tmio_mmc_host is embedded inside struct mmc_host, and thus is
    freed by the call to mmc_free_host(). Hence it must not be written to
    afterwards, as that will corrupt freed (and perhaps already reused)
    memory.
    
    Fixes: 94b110af ("mmc: tmio: add tmio_mmc_host_alloc/free()")
    Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
    Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    7df0c5a4
tmio_mmc_pio.c 31.7 KB