• Michael Ellerman's avatar
    [PATCH] ppc64: make iseries_veth call flush_scheduled_work() · 7d033a99
    Michael Ellerman authored
    When the iseries_veth driver module is unloaded there is the potential for an
    oops and also some memory leakage.
    
    Because the HvLpEvent_unregisterHandler() function did no synchronisation,
    it was possible for the handler that was being unregistered to be running
    on another CPU *after* HvLpEvent_unregisterHandler() had returned.  This
    could cause the iseries_veth driver to leave work in the events work queue
    after the module had been unloaded.  When that work was eventually executed
    we got an oops.
    
    In addition some of the data structures in the iseries_veth driver were not
    being correctly freed when the module was unloaded.
    
    This is the second patch, we make iseries_veth call flush_scheduled_work()
    after we are sure the handler is no longer running, and also fix the memory
    leaks.
    Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    7d033a99
iseries_veth.c 35.7 KB