Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4823482ybl; Wed, 22 Jan 2020 05:25:47 -0800 (PST) X-Google-Smtp-Source: APXvYqy9e+wSu2dzx3qnhkrPIKqgx2tpAlw/og4GI36iJ7NrPo3gQo+ZyNI/NMxpS3tB2dQyoKjw X-Received: by 2002:aca:814:: with SMTP id 20mr6868837oii.159.1579699547217; Wed, 22 Jan 2020 05:25:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699547; cv=none; d=google.com; s=arc-20160816; b=qOeIHmRYVcB+lnBHMc9oCIMjNX5Q9CcBykp4H9D6qR7zSO6DWuFUVtZNa4obGnQOJs muIVLrvILvS/CXGHOVdqzaSrDn4gOXdA0kDINK+2vU4/9+rZDIiZotLRnSYPV0xQk/bs w8v2ZAj3TdIL5P0uRljY3wi2e7dLN1GqM5yEIkEOuZ8pVWrsDo5bbqeOxbxabmEGchad feY+MYxedUqfFLBxeNYJoRqIRlI/GP1bLXoohXiClADFj4ZV90MDIlPNt2v2ZUo/cZZj y1BpomNWxR0QSgaB1ZzYNb15pg+zt3UeoewMZABQUVwrjLx26UAh+3IanD+LQlh+RYAJ MYag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9R1AVFbQQX/QNnG2w9iqZtKAawpjrRAxGmlE3hcqi4s=; b=etNw7a/QaA/CYzz+RStXrYzX9AgfCLCpb5YtAfzwsHW6h8PWhgA6xTup4Ucz/Qhwd4 SYvVJPpK4aSrRnw+oyqHRoWe17SSW0TuEGQQIZxnnyRjsRchae5+5sGqgMzC1beYgusl r5DYdvNUKEbZJagm+T+27dJXyW50YvUkCeSUpZ/b53wIVQVCLnj0p0Q6AL+77kAtnhnN ICjsIIF6Rv0+fL+iiVZUh8HaZGd9BxcHx5Y/YP2VIX6UpZCprCMRTUOCdYqPYxTmSAS6 oO0WPZ1BrciJGzngLSnmbBou8qKH+cLiR+F0UlDVB1IpqSqnHGx8zfgl/1lrnvZ0Soyt 92GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Njp86w47; 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 k23si20494350oiw.238.2020.01.22.05.25.35; Wed, 22 Jan 2020 05:25:47 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=Njp86w47; 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 S1730712AbgAVNYk (ORCPT + 99 others); Wed, 22 Jan 2020 08:24:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:43808 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730135AbgAVNYi (ORCPT ); Wed, 22 Jan 2020 08:24:38 -0500 Received: from localhost (unknown [84.241.205.26]) (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 5733A24688; Wed, 22 Jan 2020 13:24:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699478; bh=r8lgdM+IAdnVU5nqqGbAAWjmh/qm6nZ37gDcmBTo/Ts=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Njp86w47clMERUyd8/ggMTu7fkS/Qw1xxbYawbGdgtPFFs5JZ0v5q9JxZrifYmMRF 4Plzh39VOyJS2QMiOZCF6kUtc/FPt4EYwbthhibz7nIORKZaBwRfOeh3sll0j0O3Mb bkQWNHjOjaE3psWT1pVXq+WPZHwQ8QVBsRdT5ETE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Navid Emamdoost , Andrew Bowers , Jeff Kirsher Subject: [PATCH 5.4 158/222] i40e: prevent memory leak in i40e_setup_macvlans Date: Wed, 22 Jan 2020 10:29:04 +0100 Message-Id: <20200122092845.031107875@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Navid Emamdoost [ Upstream commit 27d461333459d282ffa4a2bdb6b215a59d493a8f ] In i40e_setup_macvlans if i40e_setup_channel fails the allocated memory for ch should be released. Signed-off-by: Navid Emamdoost Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_main.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -7168,6 +7168,7 @@ static int i40e_setup_macvlans(struct i4 ch->num_queue_pairs = qcnt; if (!i40e_setup_channel(pf, vsi, ch)) { ret = -EINVAL; + kfree(ch); goto err_free; } ch->parent_vsi = vsi;