• Neil Horman's avatar
    vmxnet3: repair memory leak · 848b1598
    Neil Horman authored
    with the introduction of commit
    b0eb57cb, it appears that rq->buf_info
    is improperly handled.  While it is heap allocated when an rx queue is
    setup, and freed when torn down, an old line of code in
    vmxnet3_rq_destroy was not properly removed, leading to rq->buf_info[0]
    being set to NULL prior to its being freed, causing a memory leak, which
    eventually exhausts the system on repeated create/destroy operations
    (for example, when  the mtu of a vmxnet3 interface is changed
    frequently.
    
    Fix is pretty straight forward, just move the NULL set to after the
    free.
    
    Tested by myself with successful results
    
    Applies to net, and should likely be queued for stable, please
    Signed-off-by: default avatarNeil Horman <nhorman@tuxdriver.com>
    Reported-By: boyang@redhat.com
    CC: boyang@redhat.com
    CC: Shrikrishna Khare <skhare@vmware.com>
    CC: "VMware, Inc." <pv-drivers@vmware.com>
    CC: David S. Miller <davem@davemloft.net>
    Acked-by: default avatarShrikrishna Khare <skhare@vmware.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    848b1598
vmxnet3_drv.c 98.9 KB