From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A7D06CCFA13 for ; Sat, 8 Nov 2025 17:20:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 64BD96066A; Sat, 8 Nov 2025 17:20:23 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id x1eixXYADE20; Sat, 8 Nov 2025 17:20:22 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org A54FF606F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1762622422; bh=245FECgiEJwbVFuGBJMyKrXvA4v2dbWrCYnXImQuMMQ=; h=Date:From:To:Cc:References:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=6cg32Toha9a9ciCD9OepMA/klTrmIYvQsmnbc9JHIWlxJihoAPF/DlQ0FhO1+rXhp f/e696lS+vZ7moWxnIEzXcSPK3od05dzgThZzyrAAX43jiS7JnmqzltnrCwoR/n3Ch ceygyIpT9hD82FOwoao8ZMUE8pnIe6o1J4lRDAc930/u94qhqlzrftIS0mNZ1xHmhx pHSLz0oHV/j1O3/FQt52lZziiJsWA9sUbCEoxPOtFXOXracYYy/flEN8RsyQBsYoI2 xIY9UsPUNL4hZvMygl91qavH/aBm0IeXpPkc5VNCqwwl16H6/bQWXrW+6Fdvf2aXYs NIZDtil0MmFaQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id A54FF606F6; Sat, 8 Nov 2025 17:20:22 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id EC1A72CD for ; Sat, 8 Nov 2025 17:20:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id DD71A606F6 for ; Sat, 8 Nov 2025 17:20:20 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id nRTqKX39hEoX for ; Sat, 8 Nov 2025 17:20:20 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=horms@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 2929D6066A DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 2929D6066A Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by smtp3.osuosl.org (Postfix) with ESMTPS id 2929D6066A for ; Sat, 8 Nov 2025 17:20:19 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 7805D60007; Sat, 8 Nov 2025 17:20:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 533CAC4AF09; Sat, 8 Nov 2025 17:20:17 +0000 (UTC) Date: Sat, 8 Nov 2025 17:20:15 +0000 From: Simon Horman To: Joshua Hay Cc: intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org Message-ID: References: <20251021233056.1320108-1-joshua.a.hay@intel.com> <20251021233056.1320108-2-joshua.a.hay@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251021233056.1320108-2-joshua.a.hay@intel.com> X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1762622418; bh=4uBXZNjEeUsMFg1PyKHuxUfuFeuIUqbxNWqH+XsncZY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fBB0NZLp5IH2E2etese6w6N2OmdjvSftvJX5j98h1R8XtJu21Q7Dfhq51/XRWtgrH hGr4UIa+biFRFYlok4QKaNz8i1PExtd5xQPoBt5ukAjyafVjOa3uctbi8Lhy6hTBuq RDfyP/jmtOk/BBdbZ3XeKr1N4c81dpgZxrZ6HxQmsyHEN+kQ55F/x/wS8fSaD2EItr EHiiq4/jamcGK1luSUdnwf8jLfsf5fsdJdslUSvaFhPNc/tHYyoUA3K7nlo3D0z8fq a+B5U3ghKA+IPCsziyZQFhGvbMqmtQXMlwmbEA29VwCRWQHKs64bIPvopCeyatp7ZV zvHPGj4ZxFPEQ== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=fBB0NZLp Subject: Re: [Intel-wired-lan] [PATCH iwl-next v9 01/10] idpf: introduce local idpf structure to store virtchnl queue chunks X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, Oct 21, 2025 at 04:30:47PM -0700, Joshua Hay wrote: ... > diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c ... > @@ -1237,6 +1242,8 @@ static struct idpf_vport *idpf_vport_alloc(struct idpf_adapter *adapter, > > return vport; > > +free_qreg_chunks: > + kfree(adapter->vport_config[idx]->qid_reg_info.queue_chunks); I think that the following is also needed here, to avoid a subsequent double-free. adapter->vport_config[idx]->qid_reg_info.queue_chunks = NULL; > free_vector_idxs: > kfree(vport->q_vector_idxs); > free_vport: ... > @@ -3658,6 +3668,11 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q) > rss_data = &vport_config->user_config.rss_data; > vport_msg = adapter->vport_params_recvd[idx]; > > + err = idpf_vport_init_queue_reg_chunks(vport_config, > + &vport_msg->chunks); > + if (err) > + return err; > + > vport_config->max_q.max_txq = max_q->max_txq; > vport_config->max_q.max_rxq = max_q->max_rxq; > vport_config->max_q.max_complq = max_q->max_complq; > @@ -3690,15 +3705,17 @@ void idpf_vport_init(struct idpf_vport *vport, struct idpf_vport_max_q *max_q) > > if (!(vport_msg->vport_flags & > cpu_to_le16(VIRTCHNL2_VPORT_UPLINK_PORT))) > - return; > + return 0; > > err = idpf_ptp_get_vport_tstamps_caps(vport); > if (err) { > pci_dbg(vport->adapter->pdev, "Tx timestamping not supported\n"); > - return; > + return err == -EOPNOTSUPP ? 0 : err; If a non-zero value is returned here, then the allocation (of adapter->vport_config[idx]->qid_reg_info.queue_chunks) made in idpf_vport_init_queue_reg_chunks() will be leaked. I think it should be both freed and set to NULL in this error path. Which I think suggests a helper to do so here and elsewhere. Flagged by Claude Code with https://github.com/masoncl/review-prompts/ > } > > INIT_WORK(&vport->tstamp_task, idpf_tstamp_task); > + > + return 0; > } ...