• Johan Hovold's avatar
    USB: mos7840: fix port-data memory leak · 80c00750
    Johan Hovold authored
    Fix port-data memory leak by moving port data allocation and
    deallocation to port_probe and port_remove.
    
    Since commit 0998d063 (device-core: Ensure drvdata = NULL when no
    driver is bound) the port private data is no longer freed at release as
    it is no longer accessible.
    
    Note that the indentation was kept intact using a do-while(0) in order
    to facilitate review. A follow-up patch will remove it.
    
    Compile-only tested.
    Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    80c00750
mos7840.c 75.8 KB