Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp948942rbd; Fri, 23 Feb 2024 08:22:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX48QlpsDMtfbTwkPFCdu+hVnGSmwcewvettFa1eI3eGcD+rfD34Q3WLqyghHTQAm+esJ9a8dTjjN3rHJnP48kPTjsB1k894+LjSU5PVQ== X-Google-Smtp-Source: AGHT+IG0z9paEko3wYhGKGD+s//Alfr6AiykBb8WbE+P8Vt2VHaZEoUTGdCEpvq/GzeIs5TDLst9 X-Received: by 2002:a05:6a20:6da1:b0:1a0:e03f:dee with SMTP id gl33-20020a056a206da100b001a0e03f0deemr302544pzb.43.1708705356647; Fri, 23 Feb 2024 08:22:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708705356; cv=pass; d=google.com; s=arc-20160816; b=yoSYSV2xjj+ctY8UfPL0V2aAiOLlyXdP/nmHUp60Sz6BwOPjG2/PeqGPDMfwD51qqa 656tkGvUgcT4M0eDKdfaSXCI560n6/YFx87fo/h+AqWccH5zRsLDtyYmLtjOkzuXC/o8 GPDpi8vDO9vMiKzkh66/rWWQZfZ767G327+vOHp95pjJYi9aA6mIesrTApW7fhGHVYPS EjUDDUMWghO80optXrYraMjcuW7sYSWTMKI+Kr697qLCrzWXZ74RSLb79ltGM0I5JRbn DLQblxigiKWFE0hmDZM+CTpDLbwepUhImmpVs1epeJWvjG+5PPlaPKzJlgtW8mB1Frts SBDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=OEEu+Q+qWiDYEjhlF6uweUjaZhpoREuloxHpZyOQEjg=; fh=/JmeIqup0OXQjlgqdMfKwEvwRZt22T4w+5FrLrWWodk=; b=pRXCdr7Bf9+63ePhTDZOe6vYt81YmIJnTIVu0lgKwMKFM50l0Ft+Y2kuWuzn5okA2N 6Jr0fTur//0G9IdKnwZn1cNWra1pJzIQqeItB+wLmXUDm4cG8Dz8mbP2k6kQMEvncAia jLYB456kpPOtXF4RaDFkuhl6ErxCbnA4EYU6O2GuKdRylX5UwOV67EbQGUukteQPgvS6 OqVUuoUriZQAigNFdyvx5itWoy9LPBP+f0TWrT/RW2JI7ARV+b2u3mNlDpO1in395JWh f3CwLRgpVEnuOA6sYc/WT+ZWK7Ha0nX5TtNSHOcbDNI9YL1L9AuRUYoUShTsCpCgzaJq tOIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Mx9yZqOo; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-78706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m127-20020a633f85000000b005d8b8c6f94csi12425030pga.565.2024.02.23.08.22.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 08:22:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=Mx9yZqOo; arc=pass (i=1 dkim=pass dkdomain=armlinux.org.uk dmarc=pass fromdomain=armlinux.org.uk); spf=pass (google.com: domain of linux-kernel+bounces-78706-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78706-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D48CD28865E for ; Fri, 23 Feb 2024 16:21:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A3AEA128372; Fri, 23 Feb 2024 16:19:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b="Mx9yZqOo" Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [78.32.30.218]) (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 DB487126F18; Fri, 23 Feb 2024 16:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=78.32.30.218 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708705169; cv=none; b=SG3gXirCibveFGtMK7exyNRKHk+SvnISTBE8m/PtGagAqGf6WhVvnGWoO6UkDA1HxsfM1VZRPDlgx5QSNxY8kZWhZiowSaeDGzhOc97eC7NiOsDpxTBN/EMrxhxSkoEtclXbrVfxhdIaZfFp9FfyxAyim/3awQysoxAc9MfFnrY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708705169; c=relaxed/simple; bh=joPzG+++ezLaON59rVXad40IOG8lQR6Z/NTYgQe0+1c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rjpiHHO9CXF5n4SzlJbM6YQbtVQPr2qwggTU4UKIzZlEiW0GuAg7dZKAGumKlGHfWnQNGQTvUDOOJ7wTgN2tcK97zwmujAtZRBQCC6x30i6CfY1YtWugov3R8A3LVuEOrXioc0I+/KA78HzZ5UMab9sXLcylGG/pvddiOFRZ6sM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk; spf=none smtp.mailfrom=armlinux.org.uk; dkim=pass (2048-bit key) header.d=armlinux.org.uk header.i=@armlinux.org.uk header.b=Mx9yZqOo; arc=none smtp.client-ip=78.32.30.218 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=armlinux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=armlinux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OEEu+Q+qWiDYEjhlF6uweUjaZhpoREuloxHpZyOQEjg=; b=Mx9yZqOo0DdCDnT5R6zSlsy58r IF4clhpSA1fM7tinhRx+lZHvNdkip/ih+F/m8QYC5tRiwnWCz0ZSlZ9I1JI8Mwfmp8mCTCA/ZwYVc JQr510o5AyWBBjathdb2eiLgAHqQ0+rT539FAjg2c6fnOHPKpLyKsH9B1q0RRg0CsPSyf4XCWVDFI 4BzI1pPQLkBD0PNZoi/RBPNxAS9ogu5Jhbb5qf8mGrKuYKbhCY6qcZCS3zE53280vRb4Ax15lQocC wb8RDktmUljlsrBbi1JubvVqgH6tyN6sM5PmO/rAq1907FdqHdb4CkL2DssSauClhT+ztAQCE9ye8 fz5NNZBA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:60606) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1rdYGV-0000Af-0X; Fri, 23 Feb 2024 16:19:11 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1rdYGU-0003kX-DS; Fri, 23 Feb 2024 16:19:10 +0000 Date: Fri, 23 Feb 2024 16:19:10 +0000 From: "Russell King (Oracle)" To: Maxime Chevallier Cc: Andrew Lunn , Heiner Kallweit , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , Johan Hovold , 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: References: <20240223160155.861528-1-maxime.chevallier@bootlin.com> <20240223170607.0d2aa8b1@device-28.home> 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-Disposition: inline In-Reply-To: <20240223170607.0d2aa8b1@device-28.home> Sender: Russell King (Oracle) On Fri, Feb 23, 2024 at 05:06:07PM +0100, Maxime Chevallier wrote: > 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. Sorry your emails came in in reverse order. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!