Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp92820lqp; Tue, 21 May 2024 20:15:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxWhRryuYKdUxzJ2b/b8lZbGSem5AwwgPBH8KFTKIl0jC+xPLfOYOkn+S35iKuhIRycJz2zWX9ApE5NM7YU4sgmQqHbURXV5j362fxmw== X-Google-Smtp-Source: AGHT+IFdf3dVUJ4m8pXwOz6Kt7h/vGPokiEeJJuP0FGXazPVk6YsbYUh2e5LpRX+ukSRFsHvSdkH X-Received: by 2002:a05:6a00:1901:b0:6f0:c828:8e0b with SMTP id d2e1a72fcca58-6f6d603dd67mr919545b3a.7.1716347716126; Tue, 21 May 2024 20:15:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716347716; cv=pass; d=google.com; s=arc-20160816; b=SgVpBtYgfc6icCYeTLmoJWjXW0icMH+mGCMWm9QyPJTVdjPLf068aVP/ZWydxrRpNG Y3p7dj93ml8lB/4iFcW49/nznnjw9oBbPOGyvEX/eCyyxrHcL2v9bZ6xgufWnfmlHSdL DJkCFcVtaM2rtDXvNWtufaybCF/LrNCVHmEghDbJnHDxYAIGBZpLnmbQFYkrs3pn0gBA AS3TFrAxsGr4sFpI3O+9Zx9pIVJ5oYicHwq3eoblvaGPTMRU6RLJLD99+1PGpn+ZEIq0 fOwNo1JaCBIEQjdTwgJcBTLNTF6ZYWlEd+c5dLJtI+rfKyqcOgroWKiMnRMSS/VGxYpA bbtg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=ml/iZayzMliUKM4mSTJoLQHObAM5gqhB0ErOZcdzWh8=; fh=RS2nKYFs6vvAzo5CxFik1MOWTZt07Yc8VveD1zFCZd8=; b=t1Q5tibgxUyjlFjrgElDIDMebQx6T75+u0oWZM5LPX+tDTjcbd2RHXSGXBkMdXxI2U 6Flg0igB3uZIfO/hG8IswbbVnbpazYk3jV3OhwH2fxP5fuED2/KlMCNbVnQU5KPn4y03 Z65PKmfhBV1rCZyd11UdGkigcuSVAtehEvfKNYizZYjVrsrD6xw0LeRQoTL4IedFk4Xs VsnoRSEyGjnJ4TLOYR9SF1wkXbqrfY2duS4sjk4NEr49rpdWsaCIFHdka8iWVhXX3lwX NpAZ+5QS941XVEC/18Ub/022h7cNVTA46lDQAfJwfIw+hvYR4GJqWJEiLzNGh+Evstj0 IiMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ebrf31jA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-185709-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-65795761c70si1852803a12.785.2024.05.21.20.15.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 May 2024 20:15:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185709-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Ebrf31jA; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-185709-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185709-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch 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 DE74CB22800 for ; Wed, 22 May 2024 03:15:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 93374745D5; Wed, 22 May 2024 03:15:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="Ebrf31jA" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 9856657CA6; Wed, 22 May 2024 03:14:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716347701; cv=none; b=Iots8qRtOkE4/Q9SIAK9J5ciWVgLkXx2aFKJaj0mgFq6BP0CMVsCfQB5nTWGyB10nxQhsXMH+S7eoXw5+ZTJ+uBxMfOVIZyyFenqrxac5uruChKuiBAdQC+7v8eyMWgq9DZkcVojBuVho6UtSypjRtF45cEsD+/hSW0Nhq1EGL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716347701; c=relaxed/simple; bh=ChglAZipxV2i+Kmf05G6SqfC7g6IDrIHEQA4dmpQ+eM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VUsjwyONVkF1RGUy32WRekU4UjglMvl0r1r4UaYUbfkveTo08mrTgnqzLF3zRZFb4+OAn8rTP2cSi992sh1zFgx5ZuTV7VO0SLOfxMi3zGx2aDZS2QaR3njROSnadomKB8rg8agoz9a7HLb57521bFHVdk04YZrQDqfjmLkKE3U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=Ebrf31jA; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=ml/iZayzMliUKM4mSTJoLQHObAM5gqhB0ErOZcdzWh8=; b=Ebrf31jA/1hC4iw7JHnXa04yJM tAuosdP8SRk+X/gOTDxpg86xjpgtUZ62f5jXr2ecsr98iRFJ8XuT6T84KNgTfJcmwGSxa39fo2oAk lxu5dZqqAsfZ2WjXlk8HYqo7NDDzM5cZ+mbXkNQpnW4FJZH0ieH7OVOc+7RUSBJRbsto=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1s9cR7-00FnqS-VJ; Wed, 22 May 2024 05:14:41 +0200 Date: Wed, 22 May 2024 05:14:41 +0200 From: Andrew Lunn To: Wei Fang Cc: Xiaolei Wang , Shenwei Wang , Clark Wang , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "imx@lists.linux.dev" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [net PATCH] net: fec: free fec queue when fec_enet_mii_init() fails Message-ID: <8bbf2c1d-5083-4321-bded-f83aba5428fa@lunn.ch> References: <20240522021317.1113689-1-xiaolei.wang@windriver.com> 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: > The commit 59d0f7465644 ("net: fec: init multi queue date structure") > was the first to introduce this issue, commit 619fee9eb13b > ("net: fec: fix the potential memory leak in fec_enet_init() ") > fixed this, but it does not seem to be completely fixed. This fix is also not great, and i would say the initial design is really the problem. There needs to be a function which is the opposite of fec_enet_init(). It can then be called in the probe cleanup code, and in fec_drv_remove() which also appears to leak the queues. Andrew