lkml.org 
[lkml]   [2022]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.16 115/186] ibmvnic: free reset-work-item when flushing
    Date
    From: Sukadev Bhattiprolu <sukadev@linux.ibm.com>

    commit 8d0657f39f487d904fca713e0bc39c2707382553 upstream.

    Fix a tiny memory leak when flushing the reset work queue.

    Fixes: 2770a7984db5 ("ibmvnic: Introduce hard reset recovery")
    Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    ---
    drivers/net/ethernet/ibm/ibmvnic.c | 4 +++-
    1 file changed, 3 insertions(+), 1 deletion(-)

    --- a/drivers/net/ethernet/ibm/ibmvnic.c
    +++ b/drivers/net/ethernet/ibm/ibmvnic.c
    @@ -2780,8 +2780,10 @@ static int ibmvnic_reset(struct ibmvnic_
    * flush reset queue and process this reset
    */
    if (adapter->force_reset_recovery && !list_empty(&adapter->rwi_list)) {
    - list_for_each_safe(entry, tmp_entry, &adapter->rwi_list)
    + list_for_each_safe(entry, tmp_entry, &adapter->rwi_list) {
    list_del(entry);
    + kfree(list_entry(entry, struct ibmvnic_rwi, list));
    + }
    }
    rwi->reset_reason = reason;
    list_add_tail(&rwi->list, &adapter->rwi_list);

    \
     
     \ /
      Last update: 2022-03-07 11:34    [W:2.087 / U:0.364 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site