Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1778236pxp; Mon, 7 Mar 2022 02:06:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2vZoLbqr24HbTR5BLCxBJbYTBSrlsrBZrD+Z1wE1/CvtPAWPam7Z9jgdiDZFZFBCJQCM/ X-Received: by 2002:a17:907:d01:b0:6d7:9f7f:ef8a with SMTP id gn1-20020a1709070d0100b006d79f7fef8amr8653524ejc.656.1646647565219; Mon, 07 Mar 2022 02:06:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646647565; cv=none; d=google.com; s=arc-20160816; b=Xm/1Ui4Q0CQxoI2HPRD0XH3cAeu7qk+YQq0pkSvWhex8S7Ya46WPmW3vPKu5zLC4bb e5FbjlKkzOiWal2jW00B1xRfAFN0dAuDmdyQ8DRBabg1lUkyIJjB28P1uVPv0hQ1gMYz v0X3uDgfce97prG2Kd79To0q5Z0bZ7rFH1hx3Xwqon4uLxVqm3SNPrFHcNU/Iw9UhNBI F/SaqL+fqkV3fgwrSy71ThLYVfnnZ+pk/NetgN4kVt8PH7qzEMA7tbobC4KKcmTI10hv ILsoaYYnRHoZX7awgXCY2dnHy/9od5SelqOg49fkmQ9uKEoLeFpkQ5W9UUXBMAolfF8l ZfLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dLM4yi9ST+L6IV7SeF+cl+RC+HRo41Pl0tAp82DeRbk=; b=phz/itl/lqHqxyIe3GOHT/MWmjWcDOi/fL0JfctRaB2sV/pj/cVmnP6BBrbNZWtPXo Xl5LAdlSGI5xK9ENyjBlHrnMXYJKlc2kSLtqpNbnJnI5bo170S0QagNH3HIpvKLLgbp9 mnop7Xs/VtoNQYfgZ6o8yUa+BGQMMTfi0eecpkbE8DsfbPNzN2i46pqxkHlSe0WeQuj3 sgLDKFbw0/6Tzry94QlemMBTkabnB97GfDJfhDxUa3O+/p4bNKMAL7UOhszD+ZzNf7dD yBscX29JcBK4nt24REJL1ZxaAiAwLojcEZj3Nl5/z8n/JVylV+DbU3c+xAc41OztZjn6 D88A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dIO6EZxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb27-20020a1709077e9b00b006d229828f46si10331295ejc.884.2022.03.07.02.05.42; Mon, 07 Mar 2022 02:06:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dIO6EZxl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237538AbiCGJc5 (ORCPT + 99 others); Mon, 7 Mar 2022 04:32:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237411AbiCGJ2F (ORCPT ); Mon, 7 Mar 2022 04:28:05 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 003BA6A02D; Mon, 7 Mar 2022 01:25:21 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 66312CE0E99; Mon, 7 Mar 2022 09:25:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61C87C340E9; Mon, 7 Mar 2022 09:25:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646645108; bh=//8m1zwi+zZ/3sM5PTHTjQJb0lPBjkVWxzhhVEtEb/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dIO6EZxlceVNsfGzMGBWrw92nuToRMe6PqDKXSCb6xXMSh8Y7O2wOTLLtTTx6vicz jqCzslXD4CRBSErBaPUtClDbeG4r7l0HtCtDYnkeHO0YQ8MxXWW50tfS5vDxA8FrPI Dudge5pR5ezy6ZXcEZc8KfE531nIfDi3PQQjUZng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sukadev Bhattiprolu , "David S. Miller" Subject: [PATCH 4.19 41/51] ibmvnic: free reset-work-item when flushing Date: Mon, 7 Mar 2022 10:19:16 +0100 Message-Id: <20220307091638.161249166@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220307091636.988950823@linuxfoundation.org> References: <20220307091636.988950823@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sukadev Bhattiprolu 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- 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 @@ -2100,8 +2100,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);