Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1826328rdb; Thu, 7 Dec 2023 09:42:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEMpz6SLUy0tIgTW9qezHXreZN/P+KnEeiJyr09/G1+XpE4Ck2rD0sSocA0sDf141+bAPlC X-Received: by 2002:a05:6a20:8f1e:b0:190:1ae1:185b with SMTP id b30-20020a056a208f1e00b001901ae1185bmr760478pzk.59.1701970951402; Thu, 07 Dec 2023 09:42:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701970951; cv=none; d=google.com; s=arc-20160816; b=TDrztnRnRjQe1rzuwQuF60OMdzOAF/Urg4sSAXlLwM4p+Z4jcuZCEmu2Fma54KS4VX ze/MJb36MamEJvjQNV03Yg87ZIfU4zldV14js+8gzWpB7/rvbwQDJ4Mzd/evTb4frl2P LkiFuxTYSqAp5WSJJKtTpt4Ke1qwMxaLb/jxDPK8Jkb4Is3qgpXEmt44CD8UCp4e+ISp BMwg1odYBdGmyHlDeQpt+GhW93Bh7kALzxfFEyXZLNah1ro2R3VD/NkNij0zMgO9dsoe NxjFfyVn5TBKLH2KMCoIATGRXOCrKKHxGvNS7MrqywxkH1aEF89jnjXW9mjqwbzY2ulD tr5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=ueATlkT6cGzCNaR+tg9RdkPwYo+J239DmToYCoGdQ+o=; fh=WEezrxLr8MBp0ajjq5ghInsWSOxjPPgt2/LdfcTHdMQ=; b=lHG/ZrHePBU4+36YMwLfmYbN0gF9mSwclNThI2FYY6VnaAwdPA93Avrpqew1gU03cy JBnIWbB/K8srX+bbvStZMSQY0mxatLyLySAIuVHtqRkD6CbrKmX4K21dCh7g/9kKpY7j oE4n64PIUVn/Y0d3NMklHapZzFJm7Lw2lcTNqpG1z2Gd3W7nuW6JU1judu0Qvt8Pix6s MdDn5VKKVnYSpaOmFSnSvI4JyG7PQrrVIOeg05eJ6NA9hWR28Vp9CTutC+RGeVpDRfrj utiqtp7aM+TBNl1Kd+JFW3SJHvGmazcwVM3JJmnklov7Fxtbg1zxyDU+I3N65d8Bif7U S7Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hO5ooNVg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id i7-20020a63e907000000b005897813624fsi44683pgh.476.2023.12.07.09.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 09:42:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hO5ooNVg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id CA09981C46FD; Thu, 7 Dec 2023 09:42:28 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443446AbjLGRmR (ORCPT + 99 others); Thu, 7 Dec 2023 12:42:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235228AbjLGRmQ (ORCPT ); Thu, 7 Dec 2023 12:42:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE80310F9 for ; Thu, 7 Dec 2023 09:42:22 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3035C433C7; Thu, 7 Dec 2023 17:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701970942; bh=XActvnt3u4hVPQCbSWjczs0CUksp+uATv6dyECFr7ds=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=hO5ooNVgtmHhpxNK2pAHaJJKLA0UwCH3ibX4kDCSuEbRyjoZ5qSC7cygJUi9d+/M+ SkzDG3gw1QKcPt9H5zbhqdQhGboNQUmbpANZMA8WAMb/pOU6pgoTA8v9CXKYFA4jLR c1k9utyZwmRhhfFehCNCQexO5GVAWtka2DJ7BphUiwYyiSGmEcWSOweJLfIRhsmxZe H4DT3Rv4O9VG/Si5ASZfjcumvO/yAsNjsQmXqfgdFRHylHPd12jaZwn6WydZ6QttdN hva/cZFoy+fBfirtYNBmPXzbWiSJfnHJ+6PUnba4sbmOJrH1t+mWyWxHL5M3y0X1Y2 5Pvzis3iLwoFA== Date: Thu, 7 Dec 2023 09:42:20 -0800 From: Jakub Kicinski To: Suman Ghosh Cc: Zhipeng Lu , Chris Snook , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Yuanjun Gong , Jie Yang , Jeff Garzik , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [EXT] [PATCH] ethernet: atheros: fix a memleak in atl1e_setup_ring_resources Message-ID: <20231207094220.77019dd0@kernel.org> In-Reply-To: References: <20231207143822.3358727-1-alexious@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 07 Dec 2023 09:42:28 -0800 (PST) On Thu, 7 Dec 2023 17:08:15 +0000 Suman Ghosh wrote: > >+ kfree(tx_ring->tx_buffer); > > [Suman] I think we should do tx_ring->tx_buffer = NULL also, to avoid use after free? It's up to the driver. Some may call that defensive programming.