Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp947846rbd; Fri, 23 Feb 2024 08:20:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUovzFWQ6tGE/X7wDYmEVEvKhus/NSh+yL7uAv1GbONxCN2jqNpZoAQiNByrnYesNrW5LGujd8zBuaDJqbRppzvbNkg3xcmDrNv6s4OYg== X-Google-Smtp-Source: AGHT+IEhFqHp4lEQaMRLALDNqU7pQntCAyW0nQKpjuKm7jAJcz+b8x8ElG3CkHQnjiAJTLTgmdoW X-Received: by 2002:a05:6a00:14cf:b0:6e4:869e:137a with SMTP id w15-20020a056a0014cf00b006e4869e137amr239635pfu.16.1708705242691; Fri, 23 Feb 2024 08:20:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708705242; cv=pass; d=google.com; s=arc-20160816; b=X2ew7JvQYX15+Hctj1GxdlBqEz8+QruvXHBnfhrzr8FPbdmDB2dXT9j3PdscJAoLw7 HzpzfFB1Einwgq4+0Oft+1Bzi303HBFj7VTyCux8KZQtiZK+Xa5bnzfRL/NP/JTp1Zju xQEOIO05534dwp+ChCQm3VQu2+K9sbZcYN4XR7W4JTsNlt0TtKI+5/ZbPUP5oYtWuYTJ LkVGudsF2o8doW7LlEttb82Ebl0gfgC6LYKq/uFxZ9N6KkqAJZcGQHVwH/SU8XkTQ++d swaNhWT3xHz0JlywXOEGeJEs/H5pzSETmgFI7vVGPsoaR8sZGPdpVT+BaNSqffuimJMs fn2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=yKnpEwT+GUdr4sidHu1T7WVOyx1tP0rVrEJh41iue8E=; fh=YIt955YEklVfcWp6qvuNNjNcAmaCfrU78DkmU3PKaUk=; b=KlYEApO7YvzGUW7gHfTpDnmOQIeP4/lSCeVo1kxawLc1ifQCNp25e1LuutU4SkaxGu cEDvSgXSKT/7Db4p1k+Pd38o/3LYYo5PH3za3SvDu0Ez6b2bq70GTQIJlGtUOdFdt+aR qVLb7oZ1vLxhwwQSJ7AvXI6PqTEhIcGPaVvAHzKFShWYQQ3vUz7QlEiXWbc9bkaeskYK k64Xy+gIPgtp+WfE2rMJQa8r4ejNfEORlON7/8d6oMQonfU+j7/JKM86fwsQpolpqzFk lGMBL0vaCt8J19haH4dyud1iYtmsaKkvDXJR+JbJkWS4wW7CGRGJBf/WnhF8wMkj+uDM vgiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dYYKWQtp; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id t13-20020a63dd0d000000b005e2b17cd8a0si9501572pgg.270.2024.02.23.08.20.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:20:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=dYYKWQtp; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-78673-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78673-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 9220CB27B1A for ; Fri, 23 Feb 2024 16:08:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B06184FB3; Fri, 23 Feb 2024 16:06:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="dYYKWQtp" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7005E83CAC; Fri, 23 Feb 2024 16:06:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708704375; cv=none; b=K5XiISXvEsrQoImvt1Lit22OV9y+3WC5cFTw1ooVOc33cpiEdjjEW+ok7MPmbNZmKnJi+SdH+sYaUI0vTWHPtD/IEgTOG8DYOk4mfBdQn70oFXq/IPJ2tQbcXKj3pZTDUMDnhsopNUnzWEmHMBg2YQsTIwYkwpmPXJ/IWpWbDSA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708704375; c=relaxed/simple; bh=yKnpEwT+GUdr4sidHu1T7WVOyx1tP0rVrEJh41iue8E=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MzA9I7CYrX2dDsc1aJCcTaSUyi6kfjBY4cEDhhOrhI7jywDkKVr+REpIJknZcYW0I+ksWe+780jkLVDCH+bnTDD+mnzhi53VtvLffCUaJky8XZ4Rr07KBTv3ghtyQ/Y86cFWenC/EaN41wkcTRGbNDGg7IC0oSSc/xa2H4svxW4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=dYYKWQtp; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id ABB86240008; Fri, 23 Feb 2024 16:06:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708704371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yKnpEwT+GUdr4sidHu1T7WVOyx1tP0rVrEJh41iue8E=; b=dYYKWQtpneyHT1LfFVIMoP1rtF3PWdboBPvFJkLWhTioSgGmd9L0wNoMA5Gh+IV/GNpEuS LZ8RyI7qGaC47hiGEiiG0IhJDXtHr4gsixqYudNaWi0qCFwDnfch2wRdNhLEzoF2a54bH4 znc3lv6OV37uEFo84+toCqrRgf419ZtTyrYFHtNa959nYpPFy/00dxSCch3cLA5+wb7qhu 1fLADf/upqwSoz6EauYtokv6M0yl1J50tN4lZ3F4rLmignnTMV+pxlg3QDV4QnGgjzf0oN A4S+pTW+vg6fphLokt6t5rfQjyzhPgh3zHygzJk6Z8ha1FOqfdR/hR4jIe0ihg== Date: Fri, 23 Feb 2024 17:06:07 +0100 From: Maxime Chevallier To: Andrew Lunn , Heiner Kallweit , Russell King , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: phy: phy_device: free the phy_device on the phy_device_create error path Message-ID: <20240223170607.0d2aa8b1@device-28.home> In-Reply-To: <20240223160155.861528-1-maxime.chevallier@bootlin.com> References: <20240223160155.861528-1-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com On Fri, 23 Feb 2024 17:01:54 +0100 Maxime Chevallier wrote: > When error'ing out from phy_device_create(), the previously kzalloc'd "dev" > pointer gets overwritten with an error pointer, without freeing it > beforehand, thus leaking the allocated phy_device. Add the missing kfree > back. Disregard , I immediatly realised that this was freed in phy_device_release in our case. Sorry about the noise. Maxime