Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3419713pxf; Mon, 29 Mar 2021 01:31:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw1mQp+GAsrVjT0/LUUJNppuxjZmnTvG2F0Zm7kmc47p3Efj0Ylp9JeKodOuC0n/u1FWpat X-Received: by 2002:aa7:d445:: with SMTP id q5mr26923295edr.382.1617006665205; Mon, 29 Mar 2021 01:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617006665; cv=none; d=google.com; s=arc-20160816; b=MO/KVOx0UB2aj4IiPM52XWmIV5FO/inrbx95eeb2B/gLGxwWuTpnJ3OXKpo6mS8+2o L7uOtb+HJis6N3/QDpAG7M4abaQhtBJ7LT2nNuwZBMvMgoPyBVA1Qd94bh5Pu2zQlJNd 9kl0EA5BHJ2XmB+xX+MmrN6KFe3XO+gfnjB8alJSuGE/b8BDFA4ZIv1AKjcQ9lItHOBJ qd4ZHXGDWGQo7v1cWW3N3QsuMwsuNq727fjtnYfGCzTtSJa99o2vyFsXMc9PTF9Bpwfk 1DOrfUyDeuhk5Xr4/JnJabDU7CW4FWV3VPwmjT+r0yzjtq7Dd8aD63Bl4ZAIMYh/qAUT tt7A== 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=qbk2U0R4WHEj/+wPFVzqeN0PK4XncrGlRWjUME3RxGA=; b=su03+mmuyky7D26N61/xl+Y73hn0tz0p6KfqN05ccvMcMb8qgEwUCnNNdc7rTfFsQN zDhun80u3AfESUfZfXqQrwBFNP2IaaSNAhvT7PYepPH6Jfz1NSdJPsYGAgtxU9Vc8TH6 vE0Os5GtAf7Bx6wccvWfjyqM0DcN3sxS9PfXVShiLJYqKQiOQOQWbUbKeIi1UrTU9dXq 4sanSwFWxGJCBWdkL0hMzhIqB0y6LooiwVJgjanIkw80SMu4NyBGuo4O5Gdncu5Zex/3 2L7COLOIqPW0sZszinWXLDWn/nSTVMMne/YlJLuid4Uw8LO2dkYzGky+4Kp5JOQy4V9S 8AGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=o8EwzPzx; 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=pass (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 qt26si12483546ejb.216.2021.03.29.01.30.42; Mon, 29 Mar 2021 01:31:05 -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=@linuxfoundation.org header.s=korg header.b=o8EwzPzx; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233730AbhC2I0k (ORCPT + 99 others); Mon, 29 Mar 2021 04:26:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:59040 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233213AbhC2IRI (ORCPT ); Mon, 29 Mar 2021 04:17:08 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CBA6D619D7; Mon, 29 Mar 2021 08:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1617005802; bh=Qf6WRzLXOfkPVr6+tyAWYIuSf30ymOOqJmelHgbPUp0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o8EwzPzxWyppwLDAlbiYwvU8qtkrZH+Jl2HpegBMMCxOp1N46vmxBvV6YN7lGYO3H 1tNZuSqks+G9f34V39HxcDQtLnU0ZzpGHy/O1Ov7XipSH6cL/ONja4bboXyuFrb+wV 2J76L8fBy4sQYNUDbHm2h5ZJ/f0jYjrPt8sKUgqs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dinghao Liu , Paul Menzel , Tony Brelinski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.10 011/221] ixgbe: Fix memleak in ixgbe_configure_clsu32 Date: Mon, 29 Mar 2021 09:55:42 +0200 Message-Id: <20210329075629.560476143@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210329075629.172032742@linuxfoundation.org> References: <20210329075629.172032742@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: Dinghao Liu [ Upstream commit 7a766381634da19fc837619b0a34590498d9d29a ] When ixgbe_fdir_write_perfect_filter_82599() fails, input allocated by kzalloc() has not been freed, which leads to memleak. Signed-off-by: Dinghao Liu Reviewed-by: Paul Menzel Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index f3f449f53920..278fc866fad4 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -9582,8 +9582,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter, ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask); err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter, input->sw_idx, queue); - if (!err) - ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx); + if (err) + goto err_out_w_lock; + + ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx); spin_unlock(&adapter->fdir_perfect_lock); if ((uhtid != 0x800) && (adapter->jump_tables[uhtid])) -- 2.30.1