From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.70 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796002401; b=2VrJBQht6uPk6LmCorN/jqxLD59Bd9JswesAvzAuu0hZFX1hJETDqmpwAo45vizAXmeh ZRE3mTA9OEKwNMMr8YE4XsHo7iDJlW02pXPj3JPOfxgw7e14I6rfDDaJ8oUFLbe1/NKeW vpaLaL3q3JUH+dttIhj7Ou+cmMVb3H7qKpXQ27iAdcLGza9o8LpdOmyvQYTjjj/fg38gs aqZms4Ru1DNbXvuC53Zqup/l0JX3ppu3fTHODihW9zgpLzQ8J5JTPL1q8DoDbFxrwe3ZP 3wc02u6Iv7BaUR8DAeni10CakdSyAwe1VmpAnbw8q7K9xoF+UVr7G9s4MNavYZ8YQnw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796002401; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Received:Date:In-Reply-To:Mime-Version: References:X-Mailer:Message-ID:Subject:From:To:Cc:Content-Type; bh=quFSDihLEKfzLFNMd+9IdXNcPfdmAse1ZROWwmOUS8k=; b=gYsUWOKJ/tpQ/TzYd9HNhuXMLtFGLfSKchOXyOYOD7CLSC52B9YNOBFxLehWTle5lmV5 sXlrXLo5S0fb2mnIyXV5uh/kCp3dYgOn93K8mhSs0PcJ9NeaA4ayOQiDm+c7LO84muRgy vi2drJePfohttVCg0U3OkT9CY7QwO+/kZWfEXqNg9SKaWo39XBlphBm+wGJZotSiHgU70 iqbh1dPaid4RHBsqirZXMSdOpRERlitwYDkVSvwRdPkCdOPX4V2y+DQGbO0zP1yhbD3xB B47AR6pUYohgRCpgtZ0wINotUeITMq48FjeFrMPGTlqZUT7BGwOAAIvhqonRXIG2eKw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=google.com; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com; dkim=pass header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=P1+V9VGP; arc=none smtp.remote-ip=74.125.224.70 Received: from mail-yx1-f70.google.com (mail-yx1-f70.google.com [74.125.224.70]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D0B7606A31C for ; Mon, 30 Nov 2026 01:33:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D0B7606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jmoroni.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20260707 header.b=P1+V9VGP Received: by mail-yx1-f70.google.com with SMTP id 956f58d0204a3-67994010b21so7895120d50.3 for ; Sun, 29 Nov 2026 17:33:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20260707; t=1796002400; x=1796607200; darn=vger.kernel.org; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:from:to:cc:subject:date:message-id:reply-to :content-type; bh=quFSDihLEKfzLFNMd+9IdXNcPfdmAse1ZROWwmOUS8k=; b=P1+V9VGPxsJRGbXminUNOFS/+Q1tMxOuXNvbDg3y2Ij5m6EhGG6mNBcT3kB3BJwCw2 MG9Vb1FmGe/MdECB5vcx//3e+yjV2Cj05X7DlJdCOUhFU8vNmY9qST4DHiEkjySFS4uP rEKvyBwNjDcl0R63O4h1fEtwY4B9on2/Jwbl00P3wmHbFmwHeSlxg7ZJmswF6l92oiDy TJGaqywH2w9k1HRlrayE5WyeU38EifqQGwNIr677kVEwUD11WaaxIVRreRF8nPIgXr4h zx7NDwHsoTMdec8dm7AL95MjK8PM4PBlxFdqs6XYZ6PjVz2NF14/wUM4E8hyUZj7qVQ+ Spfw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796002400; x=1796607200; h=content-type:cc:to:from:subject:message-id:references:mime-version :in-reply-to:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=quFSDihLEKfzLFNMd+9IdXNcPfdmAse1ZROWwmOUS8k=; b=oFRCu1QrNk0g7xyUCVBeVz2LFYt1tog39N2AVErQDDHGVOAZsHb2qa+1VT2ezqRqjd 8b++Xbbw22d4aCBGqbXmFjBdB61aw8VQDHXSuAMfQNjlk3oHzZqRDpK1ckdlKst48SoQ GZw5M+3Clv8OLSpL0HLKDzwzEYZ5MC0XdJEO8mgyT5ifQoNRN2sGzLT0dcYVjotXxA7j IeL3nvX39QigKhWxs1ES3Ir5nxELfWmpItTZz3mET5hzmdRBxWC7iK2r6lvn25CkFeuh sRDfnmYBm5xptgKQ8VqFlMnlB8rTdKH2xGbyhIJoHVlfHaP6aQkQ33tBhEKCml+azhu8 9qWw== X-Gm-Message-State: APuU4Z85k8d69plCbwnWAvv8cfearpqUDIQ13IwolGkKC3FGis3nUWXI JXs7iZ8/c6zTA0tHU10XNDsFZcZwg79hb5jMFRaUB8n6CmpnpFANFtaQ4k4Fi8L8wqDtv4BACak 5VJrMxCYJYQ== X-Received: from yxpn1.prod.google.com ([2002:a53:c4c1:0:b0:67b:ebbb:a796]) (user=jmoroni job=prod-delivery.src-stubby-dispatcher) by 2002:a05:690e:1286:b0:67c:1b09:b8a3 with SMTP id 956f58d0204a3-67df44101a7mr14095401d50.28.1796002400016; Sun, 29 Nov 2026 17:33:20 -0800 (PST) Date: Mon, 30 Nov 2026 01:33:00 +0000 In-Reply-To: <20261130013307.2848330-1-jmoroni@google.com> X-Mailing-List: linux-rdma@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Mime-Version: 1.0 References: <20261130013307.2848330-1-jmoroni@google.com> X-Mailer: git-send-email 2.56.1.839.g22a8290db9-goog Message-ID: <20261130013307.2848330-2-jmoroni@google.com> Subject: [PATCH rdma-next 1/8] RDMA/irdma: Fix QP ID leak when QP creation fails early From: Jacob Moroni To: tatyana.e.nikolova@intel.com, jgg@ziepe.ca, leon@kernel.org Cc: linux-rdma@vger.kernel.org, jdz@google.com, Jacob Moroni Content-Type: text/plain; charset="UTF-8" irdma_free_qp_rsrc() frees the QP ID stored in sc_qp.qp_uk.qp_id, but that field is not set until irdma_uk_qp_init(). If QP creation fails before then, the field is still zero and the allocated ID is leaked. For a GEN3 GSI QP, the vport and hwqp1_rsvd are not released either. Fix this by storing the QP ID as soon as it is allocated. While in there, remove the redundant assignment of qp. Fixes: d6ed4b69b8ea ("RDMA/irdma: Add GEN3 virtual QP1 support") Signed-off-by: Jacob Moroni --- drivers/infiniband/hw/irdma/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/irdma/verbs.c b/drivers/infiniband/hw/irdma/verbs.c index 04ebba436eea..5c4da4bb0779 100644 --- a/drivers/infiniband/hw/irdma/verbs.c +++ b/drivers/infiniband/hw/irdma/verbs.c @@ -1117,8 +1117,8 @@ static int irdma_create_qp(struct ib_qp *ibqp, iwqp->ibqp.qp_num = qp_num; } + qp->qp_uk.qp_id = qp_num; iwqp->iwpd = iwpd; - qp = &iwqp->sc_qp; iwqp->iwscq = to_iwcq(init_attr->send_cq); iwqp->iwrcq = to_iwcq(init_attr->recv_cq); iwqp->host_ctx.va = init_info.host_ctx; -- 2.56.1.839.g22a8290db9-goog