Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp388012pxa; Tue, 11 Aug 2020 05:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPT2f/mq+apjl6ZtGEgp6zydnvnGAH1YvvzfwAFnLz5T6ugV+ijIF29WOGnvyq1FllTqkP X-Received: by 2002:a17:906:248b:: with SMTP id e11mr25895683ejb.280.1597150070286; Tue, 11 Aug 2020 05:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597150070; cv=none; d=google.com; s=arc-20160816; b=OeWFgWyH55yAoo4bm0xEO+goZulxjITT5qh2Q9qL5WLMOmzsTOCpV+axZ4AxzjVZbW fcyLxdsjKp3b5ZouQY0UsMJpSsLwp6xD1diq5WzbqXvsx1SHXtqjvM/G9C0cVMR/4gv4 bA0AOepnrsU1vHE9VnKqjqaUtbhrAUfO1rBBNUmBNHu5gSTVzhlaEBCi9r5atO5NVf84 4WnWOM3W79B11DjttEr1YgBx2qhlmXUG0Ga6AfKnWFrwUnGFCKUyZFFFYRW+MyRs+sn3 aiKGiCLdhPHOkWI4pQp0+9eUeM0dZ8xbdTPD9wixuhj1CeszYvVLBZHFnd0vbFnnWhX4 Ysgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=njY7bX1B+BbAVIRRQ6wRkBlf3dfXj98ejICuA3kFIRo=; b=y5MsAicGLYFIJVCiwAicJN2+j7PIiRZGJ6K+T8JlM8lbw9VtlbUsmEiSj/bOopSYTL YQQShyKRMU/mW9FJMCesG+LuFOHDpmdoYl/wApNnrdToPKnRSNbGDEJxMW//UXEpoQpN b7MhlNmJvJOea2PsJdhYnzb4zN6y5Hp5nvknC35ExVxoeH2X8qg1wStw9mG32jeA2XVf 5nS7gEt5GICYyVJsnqRhbHXArYC8xK0y+cdpxmbUimqBZ5mp+Q81jGw8yue9SwOU+5TI ai2ZsFBNlUWaXTsQDnWMa86m2NGW7VQ+hc8xWI/nKP+VYYu30dUyQpGO0v/e18msSGN+ dmag== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba10si2746279edb.472.2020.08.11.05.47.25; Tue, 11 Aug 2020 05:47:50 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728555AbgHKMqf (ORCPT + 99 others); Tue, 11 Aug 2020 08:46:35 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:39428 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726966AbgHKMqe (ORCPT ); Tue, 11 Aug 2020 08:46:34 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id EAB7F1C0BD8; Tue, 11 Aug 2020 14:46:29 +0200 (CEST) Date: Tue, 11 Aug 2020 14:46:14 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, Martyna Szapar , Andrew Bowers , Jeff Kirsher , Jesse Brandeburg Subject: Re: [PATCH 4.19 47/48] i40e: Memory leak in i40e_config_iwarp_qvlist Message-ID: <20200811124614.2myealhkhnla6v3a@duo.ucw.cz> References: <20200810151804.199494191@linuxfoundation.org> <20200810151806.541597863@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pkqhj7nvnn7tsqgk" Content-Disposition: inline In-Reply-To: <20200810151806.541597863@linuxfoundation.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --pkqhj7nvnn7tsqgk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Martyna Szapar >=20 > [ Upstream commit 0b63644602cfcbac849f7ea49272a39e90fa95eb ] >=20 > Added freeing the old allocation of vf->qvlist_info in function > i40e_config_iwarp_qvlist before overwriting it with > the new allocation. Ok, but this also other error paths: > --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c > +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c > @@ -449,16 +450,19 @@ static int i40e_config_iwarp_qvlist(stru > "Incorrect number of iwarp vectors %u. Maximum %u allowed.\n", > qvlist_info->num_vectors, > msix_vf); > - goto err; > + ret =3D -EINVAL; > + goto err_out; > } And it is no longer freeing data qvlist_info() in this path. Is that correct? Should it goto err_free instead?=20 > @@ -512,10 +518,11 @@ static int i40e_config_iwarp_qvlist(stru > } > =20 > return 0; > -err: > +err_free: > kfree(vf->qvlist_info); > vf->qvlist_info =3D NULL; > - return -EINVAL; > +err_out: > + return ret; > } Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --pkqhj7nvnn7tsqgk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCXzKTFgAKCRAw5/Bqldv6 8nD1AJ9hp8KEZX9mmHBxiUCrpm+Gq6mugACfR7ihn9zGN+1XhiI1cZej7g1gahQ= =eSCO -----END PGP SIGNATURE----- --pkqhj7nvnn7tsqgk--