Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1086995pxk; Fri, 25 Sep 2020 06:02:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPisS+fSq+lYOyAm3gNnOKQ71UKX+O0ZcdHK+fGpd0xNY/RNoz4W3xAYeXcmM4IhNWj4bR X-Received: by 2002:a17:906:f246:: with SMTP id gy6mr2540896ejb.373.1601038951309; Fri, 25 Sep 2020 06:02:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601038951; cv=none; d=google.com; s=arc-20160816; b=xB1gIrnhqzPFFVRk3GzDFfFMDKStDZCw78XlnJScpXUeiIa/IZf600SyMjkM4PpFJe +QrFIq+47TX3Mo2MmbApVo0Ex7qwoFPD6zEu6fb00JSPqKTwQoeQtGtdDIuKYzrwCrae W1wGDrMVWtgciynaEr9E1VrhgBINpCyzzTNzP4UP1zDw55Gccs/xE9p43zzs7sJkm9K6 wIUHwaqYQB7EKITXkX/nR76Z8qxM4poY6/6V0KSpD91J1oUuXpmmmTxmD5d6dsi+nqVs U+eGRWI81PAbzlUbCoJdLNB8JGZMuH+gKmvnzetG4j+PvX1j58bYpgoOylG9594g6LKl vfvQ== 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=OSYfbOY3rvxWVs6HCeUgdtMIVvlasyilUhtYws07yQw=; b=l4xdbqwPottdOkYoCgvdmiWaKUKLMDSsOLGHM7Pu3oDee2kzSORDuvqN2q915XsxeO M29iDYnjodY2Q0Uy+8m2GCKHdafrQ4+WRFhys1+24Xb3dJ/MR+KISPXPNaXYz7DPhvIV ly6teY2VaYzmXAspps6/1VItZ09yYZuAwXwHJnROB9cmiG4vVxe/3P2RAA8KOsErVC7a hTY73qGrj9pROXm0M1jK8n0aN4gc+he5xg66ywrNeKT+7t66qQ6psxgzQLkauNd38WqV On8aHbCPCzpRIzWGlMqey7Y8dgcZffHm8/a+DNiea4Gf2/0ZqcJNH18H7vep0caS8O47 vGtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ktRDDqnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y25si1703863edt.563.2020.09.25.06.01.58; Fri, 25 Sep 2020 06:02:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ktRDDqnN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728944AbgIYM6H (ORCPT + 99 others); Fri, 25 Sep 2020 08:58:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53552 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728951AbgIYMtr (ORCPT ); Fri, 25 Sep 2020 08:49:47 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 109C021741; Fri, 25 Sep 2020 12:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601038187; bh=IVhxxjkyCwp0Kcn8Rl7vIe6uy1bQQKhwMpGCiEwFruw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ktRDDqnNDLqXbm2PGtzWgdVA61YfPqgdCR144eGjVfiMpa/qGdFbhUOPzIVuhUTdN 3Js9mwgqJEfSdZ04aPQXITmlvAvHqQ0QoGgY9ArE7RdYvf2J6W0XJMvTKLyi2epl4v jc6H+qdHxEPmaAcTHso05hSuEOO0NWidBnA7NaUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Raju Rangoju , "David S. Miller" Subject: [PATCH 5.8 06/56] cxgb4: fix memory leak during module unload Date: Fri, 25 Sep 2020 14:47:56 +0200 Message-Id: <20200925124728.808796966@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200925124727.878494124@linuxfoundation.org> References: <20200925124727.878494124@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Raju Rangoju [ Upstream commit f4a26a9b311d7ff9db461278faf2869d06496ef8 ] Fix the memory leak in mps during module unload path by freeing mps reference entries if the list adpter->mps_ref is not already empty Fixes: 28b3870578ef ("cxgb4: Re-work the logic for mps refcounting") Signed-off-by: Raju Rangoju Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c @@ -229,7 +229,7 @@ void cxgb4_free_mps_ref_entries(struct a { struct mps_entries_ref *mps_entry, *tmp; - if (!list_empty(&adap->mps_ref)) + if (list_empty(&adap->mps_ref)) return; spin_lock(&adap->mps_ref_lock);