Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp4132264ybd; Tue, 25 Jun 2019 14:52:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYD92zWHL3vKtbwRVr5UIFIiKhqHlDI1RX6rasEEukeN3HxlHVtb9lghsMlrmBLas5Iupb X-Received: by 2002:a63:d1d:: with SMTP id c29mr31522639pgl.251.1561499525205; Tue, 25 Jun 2019 14:52:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561499525; cv=none; d=google.com; s=arc-20160816; b=fgLXcrbLnz0+6bK2oye9ixAxVJ745Q1aKnIy0Ivfbn6HH6s+xH7H2f+lpcfAVP+e48 acuT+XO07OqjJcTq5Gmnx/7bSswhaHjEbD9ooHrsd7XMD50igRYiL2bl4kdO2hQ/BW0K 3YnO0gdoBjRw87inxCiKrxq7cAMbNF9zYcu3wPaD5EqQ6Pdgb1USc3mJmWh3bhXmB5Iw rXXHDbHCmq243oq/grseZgFeSrC6wCMgkC6UxGqVuo4pW7Rdj59nVoPmBYPk+eZgpb8B +cYuPWPjNJzoQ2eh3xvkU/5pJ88M1Wv86R+GvDo/lcRQo46CIxApfQlJbWQlZBuT0tou eNrA== 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=yMEpn4+sKraL50YLwdPN/sLy8srs8hFna8JFBzq9UUw=; b=0mHsXaAK7PGNTpTRjlA2TF6evEeFLQS6ZSiKoR96J9oj3hq2SlB4Q1V4b+cO5asS7u pOHok0hvrNb8ZrOsBMdGiu1HdoOLzb7MHZUJrh6gbQXfGyPDzbBlwhVkBP0vd+HKD2hf aa5HhZla2tQhkNFkLUn2AxYdJBZMfATTLC3VX7PXZ+mHGBNchuVFRpQ1I2CWOcwnEN4a zMyK5QnDl9ltgI2AbjJd0gvnHy0AI0vc6WG8oTTB9s3fVINvK66CQk6hPBrHDlLMEjmY ya6GaFmlSYPWJzTzemcAJ/CC6OnHBAM+GmAXAsUyMex6+z/0m79ztp3juLwcIsICawEm HpZA== 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 f10si14278135pgg.348.2019.06.25.14.51.48; Tue, 25 Jun 2019 14:52:05 -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 S1726376AbfFYVvk (ORCPT + 99 others); Tue, 25 Jun 2019 17:51:40 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:35172 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbfFYVvj (ORCPT ); Tue, 25 Jun 2019 17:51:39 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id E749580792; Tue, 25 Jun 2019 23:51:25 +0200 (CEST) Date: Tue, 25 Jun 2019 23:51:36 +0200 From: Pavel Machek To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org, syzbot+7fddca22578bc67c3fe4@syzkaller.appspotmail.com, Eric Biggers , Johannes Berg Subject: Re: [PATCH 4.19 84/90] cfg80211: fix memory leak of wiphy device name Message-ID: <20190625215135.GA32248@amd> References: <20190624092313.788773607@linuxfoundation.org> <20190624092319.410368076@linuxfoundation.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <20190624092319.410368076@linuxfoundation.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Eric Biggers >=20 > commit 4f488fbca2a86cc7714a128952eead92cac279ab upstream. >=20 > In wiphy_new_nm(), if an error occurs after dev_set_name() and > device_initialize() have already been called, it's necessary to call > put_device() (via wiphy_free()) to avoid a memory leak. =2E... > --- a/net/wireless/core.c > +++ b/net/wireless/core.c > @@ -498,7 +498,7 @@ use_default_name: > &rdev->rfkill_ops, rdev); > =20 > if (!rdev->rfkill) { > - kfree(rdev); > + wiphy_free(&rdev->wiphy); > return NULL; > } Is kfree(rdev) still neccessary? drivers/net/wireless/marvell/libertas/cfg.c seems to suggest so. Best regards, Pavel --=20 (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blo= g.html --EeQfGwPcQSOJBaQU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAl0Sl2cACgkQMOfwapXb+vLhTwCglgF6Ac1EPb3f4Ml0x9RvA0e/ TwcAn35frZye+nut7S+KbBU6lPQZWLqb =WN88 -----END PGP SIGNATURE----- --EeQfGwPcQSOJBaQU--