Received: by 10.192.165.156 with SMTP id m28csp1091017imm; Wed, 11 Apr 2018 12:14:00 -0700 (PDT) X-Google-Smtp-Source: AIpwx49wXTD0gmdN0lLXjo74Kl3vyYoOv8vp6Fs3KuQQ4WYub6bxyaQq7oi7vayO7yxNRwg6cnHL X-Received: by 2002:a17:902:784c:: with SMTP id e12-v6mr6441423pln.60.1523474040898; Wed, 11 Apr 2018 12:14:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523474040; cv=none; d=google.com; s=arc-20160816; b=ofhTCIeYdQkGJTEdgXGrNn67CVqxQgMfuiA8qw+B+fMONwImxv+TSndLP2H20qkMA4 im+tuetDhyrI4APG7upAql8FaWsk1KRcji287NOv2WeBh4turELGxF82FLMT7O65iDAh e4iL/RWpm4hf8dEFOIorkbawDS7tdJwKhnBZrGB7bOvql8Q0mdHa2f/WPfvGayx1CRgx +D4x0/zVcNw9VRgdt4viwRRGeuav6TPC9OayC7eEca+8urwhGUicISVCt+Q2VrEJxh0h 7qutwfaoknl8VUcC5nephjLEhlBqyizm/TFqIcittaHkPPeVYRfxMdzr21z8IxDXB/L+ XEIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=wxYWjG/ogr2IyQp8cw3gqEXLEOFH7dku/08UwMpK1wE=; b=KYNnd4H8e/dQifIA5aKepVTaE7nU58yCzOvqdNBaS8MhKTiVSSS1hinXPp4ZnME0DP 9MXFc0ZFjd6lFDiHKA9Mci2B8BQCCMxfxt36rTN4kxdn/Rgk2VdFkc50Qr1VPFNE2dnk vUz/DaIPtYCIHyLW6/fJAo869J3VJeXO+e8to+t1pIwDAQL9iU36uOS/mjGV8eSrZJTg me2sJn0vJ/ocuNAfDNx0Ly3V9zYYxlURVdCvCE/lkFXJ0lldtYjuuToZPVecKemmvDrd 2CrVDiXp1VSdloIs87GrA7X3o/ZByfazW2CXhtS+4A0V8RErlU1lZwQVAE+W0a0ZihW3 CgSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10-v6si158911pli.419.2018.04.11.12.13.24; Wed, 11 Apr 2018 12:14:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935296AbeDKTGp (ORCPT + 99 others); Wed, 11 Apr 2018 15:06:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40878 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935281AbeDKTGl (ORCPT ); Wed, 11 Apr 2018 15:06:41 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 1601AD57; Wed, 11 Apr 2018 19:06:40 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Moshe Shemesh , Tariq Toukan , "David S. Miller" Subject: [PATCH 4.9 307/310] net/mlx4_core: Fix memory leak while delete slaves resources Date: Wed, 11 Apr 2018 20:37:26 +0200 Message-Id: <20180411183635.743472851@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180411183622.305902791@linuxfoundation.org> References: <20180411183622.305902791@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Moshe Shemesh [ Upstream commit 461d5f1b59490ce0096dfda45e10038c122a7892 ] mlx4_delete_all_resources_for_slave in resource tracker should free all memory allocated for a slave. While releasing memory of fs_rule, it misses releasing memory of fs_rule->mirr_mbox. Fixes: 78efed275117 ('net/mlx4_core: Support mirroring VF DMFS rules on both ports') Signed-off-by: Moshe Shemesh Signed-off-by: Tariq Toukan Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c +++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c @@ -5048,6 +5048,7 @@ static void rem_slave_fs_rule(struct mlx &tracker->res_tree[RES_FS_RULE]); list_del(&fs_rule->com.list); spin_unlock_irq(mlx4_tlock(dev)); + kfree(fs_rule->mirr_mbox); kfree(fs_rule); state = 0; break;