zsYOLzy/YxbPWXxlELTFIPBrft/5wodI5X0hWTGPBt+A5kI6YJjM7srBcgrXOKvP5pHo09+yqa7Tz56+qDPfBTg4YA5R+AWOuKfQREGs8HptrQ7s8UwyUXboVz0o12DLYH+ZA=
ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org;
	s=arc-20240116; t=1762238103; c=relaxed/simple;
	bh=s7tSXwvHJ4PEs4y4Dec7uGqloATEs+Wo8gpI0FbMsVw=;
	h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
	 To:Cc:Content-Type; b=MPLhMCgy529Dt9WX9tBrH5R5N8mDCd95t5CWHv3wPbM0sqDb8o0BQD7wJ/RQBy4oNsXjZ0F2Pun4Yhscd4xoVmfrjusrsyS18Jeg9T+KyZX+yTyy4VlFgnJp8y5nZ30wJKUuFh6WrnCJ+bB+gLhSnSDzzaPOHTyHUk77x4zD/CA=
ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ionos.com; spf=pass smtp.mailfrom=ionos.com; dkim=pass (2048-bit key) header.d=ionos.com header.i=@ionos.com header.b=UJ/02os6; arc=none smtp.client-ip=209.85.208.51
Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=ionos.com
Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ionos.com
Received: by mail-ed1-f51.google.com with SMTP id 4fb4d7f45d1cf-64075080480so903993a12.0
        for <stable@vger.kernel.org>; Mon, 03 Nov 2025 22:35:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=ionos.com; s=google; t=1762238100; x=1762842900; darn=vger.kernel.org;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:from:to:cc:subject:date
         :message-id:reply-to;
        bh=VQmAzRgv0Utq69TMSo5XIPtDul3xsXRYMQU9Qcm5TFs=;
        b=UJ/02os6zo6tb9bDRTkqMwIS61zY1zWPRNHYWyZ4XtROs4qz91MoYxWQbv1F5e/2Ok
         gcpesx6W+xbR109qRf2mcHQMBpsCfDiL7EQygq7QMT5LtgrvDBrlvYApNOs7jOEI45WI
         TncHRFiMX42iv4wAWs2YCLslQXwyDMJXDK+88PPiVmpmiyjGu0tSd8YNVvwVZ9/GbEqp
         SZ2c1TcRVA64P+5gj6M0dKRk/iEXVkQQsqpaNgCSeGtyqWbKbnYj/z/3VsBptc3UK7jN
         rrHxyqUJzDNhK16dWbby2NtTZQ3H1QoB3glxxyobzlAxDsm2xFi53X3dIitP3gN3v96u
         2LtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20230601; t=1762238100; x=1762842900;
        h=content-transfer-encoding:cc:to:subject:message-id:date:from
         :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to;
        bh=VQmAzRgv0Utq69TMSo5XIPtDul3xsXRYMQU9Qcm5TFs=;
        b=Bx/pRrWc6Seohpfdzx77xroGR+7RNpV40XDK7LmPrwbBnrE/FbPeR+etPaK6yNecXH
         MFUNsWoygnHcJxosSoVCxj4i8qtD6EHqEed8pGaAI0Cmh1+2wHAXCht1kLQyS+rjnQQ0
         KvKMHFQHiiO4ZtJ25CPslssC/oQZhj1zOmrTRF0X/YUuHqw0aoSBGBwQ/bNkORZIJo6u
         rZGV5QlTvFvuzCYD6zJPh5sDL8+xBKiKeKp2ATH+6qiCPHWpINcnCgY65y7MzVSBDRLb
         m+DUHlsRCeIgIdlhHCuRVRP78tcmAWYorY5RGrK99YYRnlaMgBfLC79vVVyd5Xpe0ipz
         cXdA==
X-Forwarded-Encrypted: i=1; AJvYcCWx48LhJvf1+EBn2v8vGe5n4/+M7z1DkLdtIHttGUnBVeEm/+vOJsUb0BQ2/TLuFItmovY+lzQ=@vger.kernel.org
X-Gm-Message-State: AOJu0YyOxi+SbXgnoetUmf5Ze2S58tlYJ7zkNRlZHAxOWJwkEPhHDQ14
	desz74ygt0iG7E8ZdiTeJoDAybiTvkoDuQn+vehIaJRBu2Dezjuf0nj5dURZE2nJJ214LyNFrQJ
	1fVLjD0y9urQQHnkyGe2o6143z0KcAtMqapSMsgkkrw==
X-Gm-Gg: ASbGncvPqXdPOH63Jf054XGaaWm44O2laGPflEfFiWPojczycKBwXqEQ1lf+pDyUJfq
	SVX75NWe7K0jfTNLlyL4yKjy6wXfqLRlAe1pdCtkMRsay0A8uX58jKZc1GexncHh2NtkWOloTAZ
	bLJiGYfvmwHN8be9OAmSHmiIBpWWgnKeMcm6/iVNKLEMmadl+QgrOWFUxBNG/qc3mbV5uY8030D
	rn/SH6sAtfma77GG3IU4oeEWRRUSRF8CcjKW/ekHgPrsxRwc5POouipi7+xepix4TT2QTZtvTWP
	Tpuwe0/EOe9O9neXrg==
X-Google-Smtp-Source: AGHT+IFhN63cUrkNgr3auzZxHZID+sIcCpWhSj3aZ/0+3dxL73E0sC1Ila0n0+af/sQcBRu6sYvHwe1uf0SeulBLdKk=
X-Received: by 2002:a05:6402:26c2:b0:640:acc8:eff6 with SMTP id
 4fb4d7f45d1cf-640acc8f300mr4453850a12.0.1762238099728; Mon, 03 Nov 2025
 22:34:59 -0800 (PST)
Precedence: bulk
X-Mailing-List: stable@vger.kernel.org
List-Id: <stable.vger.kernel.org>
List-Subscribe: <mailto:stable+subscribe@vger.kernel.org>
List-Unsubscribe: <mailto:stable+unsubscribe@vger.kernel.org>
MIME-Version: 1.0
References: <20251104021900.11896-1-make24@iscas.ac.cn>
In-Reply-To: <20251104021900.11896-1-make24@iscas.ac.cn>
From: Jinpu Wang <jinpu.wang@ionos.com>
Date: Tue, 4 Nov 2025 07:34:49 +0100
X-Gm-Features: AWmQ_bn1fsvxkVFYJEeS6HPOZ4jil9W2MtbfRXCQLvctJqd1ASYUjnERunBcB1Q
Message-ID: <CAMGffE=0LXyzcg7tew15tV1zgVAaHA2XMHcf5=14k3k0KuzNXQ@mail.gmail.com>
Subject: Re: [PATCH] RDMA/rtrs: server: Fix error handling in get_or_create_srv
To: Ma Ke <make24@iscas.ac.cn>
Cc: haris.iqbal@ionos.com, jgg@ziepe.ca, leon@kernel.org, 
	danil.kipnis@cloud.ionos.com, linux-rdma@vger.kernel.org, 
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org, 
	stable@vger.kernel.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-DKIM: signer='ionos.com' status='pass' reason=''
DKIMCheck: Server passes DKIM test, 0 Spam score
X-Spam-Score: 0.4 (/)
X-Spam-Report: Spam detection software, running on the system "witcher.mxrouting.net", has
 performed the tests listed below against this email.
 Information: https://mxroutedocs.com/directadmin/spamfilters/
 ---
 Content analysis details:   (0.4 points)
 ---
  pts rule name              description
 ---- ---------------------- -----------------------------------------
  0.0 RCVD_IN_DNSWL_BLOCKED  RBL: ADMINISTRATOR NOTICE: The query to
                             DNSWL was blocked.  See
                             http://wiki.apache.org/spamassassin/DnsBlocklists#DnsBlocklists-dnsbl-block
                              for more information.
                             [142.0.200.124 listed in list.dnswl.org]
  1.5 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
  0.1 DKIM_SIGNED            Message has a DKIM or DK signature, not necessarily
                             valid
 -0.1 DKIM_VALID_AU          Message has a valid DKIM or DK signature from
                             author's domain
 -0.1 DKIM_VALID             Message has at least one valid DKIM or DK signature
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
SpamTally: Final spam score: 4

On Tue, Nov 4, 2025 at 3:19=E2=80=AFAM Ma Ke <make24@iscas.ac.cn> wrote:
>
> get_or_create_srv() fails to call put_device() after
> device_initialize() when memory allocation fails. This could cause
> reference count leaks during error handling, preventing proper device
> cleanup and resulting in memory leaks.
>
> Found by code review.
>
> Cc: stable@vger.kernel.org
> Fixes: 9cb837480424 ("RDMA/rtrs: server: main functionality")
> Signed-off-by: Ma Ke <make24@iscas.ac.cn>
lgtm, thx!
Acked-by: Jack Wang <jinpu.wang@ionos.com>
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-srv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-srv.c b/drivers/infiniband/=
ulp/rtrs/rtrs-srv.c
> index ef4abdea3c2d..9ecc6343455d 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-srv.c
> @@ -1450,7 +1450,7 @@ static struct rtrs_srv_sess *get_or_create_srv(stru=
ct rtrs_srv_ctx *ctx,
>         kfree(srv->chunks);
>
>  err_free_srv:
> -       kfree(srv);
> +       put_device(&srv->dev);
>         return ERR_PTR(-ENOMEM);
>  }
>
> --
> 2.17.1
>


From - Tue Nov 04 06:51:06 2025
X-Mozilla-Status: 0001
X-Mozilla-Status2: 00000000
Return-Path: <linux-s390+bounces-14478-hi=josie.lol@vger.kernel.org>
Delivered-To: hi@josie.lol
Received: from witcher.mxrouting.net
	by witcher.mxrouting.net with LMTP
	id eG9wAlWiCWk4hB8AYBR5ng
	(envelope-from <linux-s390+bounces-14478-hi=josie.lol@vger.kernel.org>)
	for <hi@josie.lol>; Tue, 04 Nov 2025 06:51:01 +0000
Return-path: <linux-s390+bounces-14478-hi=josie.lol@vger.kernel.org>
Envelope-to: hi@josie.lol
Delivery-date: Tue, 04 Nov 2025 06:51:01 +0000
Received: from sv.mirrors.kernel.org ([139.178.88.99])
	by witcher.mxrouting.net with esmtps  (TLS1.3) tls TLS_AES_256_GCM_SHA384
	(Exim 4.98)
	(envelope-from <linux-s390+bounces-14478-hi=josie.lol@vger.kernel.org>)
	id 1vGAse-00000009CI8-2t35
	for hi@josie.lol;
	Tue, 04 Nov 2025 06:51:01 +0000
Rec