• Jeff Garzik's avatar
    libata: Fix use-after-iounmap · aa8f0dc6
    Jeff Garzik authored
    Jens Axboe pointed out that the iounmap() call in libata was occurring
    too early, and some drivers (ahci, probably others) were using ioremap'd
    memory after it had been unmapped.
    
    The patch should address that problem by way of improving the libata
    driver API:
    
    * move ->host_stop() call after all ->port_stop() calls have occurred.
    
    * create default helper function ata_host_stop(), and move iounmap()
    call there.
    
    * add ->host_stop_prewalk() hook, use it in sata_qstor.c (hi Mark).
    sata_qstor appears to require the host-stop-before-port-stop ordering
    that existed prior to applying the attached patch.
    aa8f0dc6
libata-core.c 92.6 KB