• S
    firmware: coreboot: Unmap ioregion after device population · 20edec38
    Stephen Boyd 提交于
    Both callers of coreboot_table_init() ioremap the pointer that comes in
    but they don't unmap the memory on failure. Both of them also fail probe
    immediately with the return value of coreboot_table_init(), leaking a
    mapping when it fails. The mapping isn't necessary at all after devices
    are populated either, so we can just drop the mapping here when we exit
    the function. Let's do that to simplify the code a bit and plug the leak.
    
    Cc: Wei-Ning Huang <wnhuang@chromium.org>
    Cc: Julius Werner <jwerner@chromium.org>
    Cc: Brian Norris <briannorris@chromium.org>
    Cc: Samuel Holland <samuel@sholland.org>
    Fixes: 570d30c2 ("firmware: coreboot: Expose the coreboot table as a bus")
    Signed-off-by: NStephen Boyd <swboyd@chromium.org>
    Reviewed-by: NJulius Werner <jwerner@chromium.org>
    Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    20edec38
coreboot_table.c 3.7 KB