• Thomas Petazzoni's avatar
    dma: mv_xor: fix error handling of mv_xor_channel_add() · ab6e439f
    Thomas Petazzoni authored
    When mv_xor_channel_add() fails for one XOR channel, we jump to the
    err_channel_add label to clean up all previous channels that had been
    initialized correctly. Unfortunately, while handling this error
    condition, we were disposing the IRQ mapping before calling
    mv_xor_channel_remove() (which does the free_irq()), which is
    incorrect.
    
    Instead, do things properly in the reverse order of the
    initialization: first remove the XOR channel (so that free_irq() is
    done), and then dispose the IRQ mapping.
    
    This avoids ugly warnings when for some reason one of the XOR channel
    fails to initialize.
    Signed-off-by: default avatarThomas Petazzoni <thomas.petazzoni@free-electrons.com>
    Signed-off-by: default avatarJason Cooper <jason@lakedaemon.net>
    ab6e439f
mv_xor.c 36.2 KB