From: Leon Romanovsky <leon@kernel.org>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: kernel-janitors@vger.kernel.org, linux-rdma@vger.kernel.org,
Cheng Xu <chengyou@linux.alibaba.com>,
Jason Gunthorpe <jgg@ziepe.ca>,
Kai Shen <kaishen@linux.alibaba.com>,
Yang Li <yang.lee@linux.alibaba.com>,
cocci@inria.fr, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/erdma: Fix exception handling in erdma_accept_newconn()
Date: Sun, 19 Mar 2023 13:41:31 +0200 [thread overview]
Message-ID: <20230319114131.GC36557@unreal> (raw)
In-Reply-To: <f0f96f74-21d1-f5bf-1086-1c3ce0ea18f5@web.de>
On Sat, Mar 18, 2023 at 09:15:58PM +0100, Markus Elfring wrote:
> Date: Sat, 18 Mar 2023 21:08:58 +0100
>
> The label “error” was used to jump to another pointer check despite of
> the detail in the implementation of the function “erdma_accept_newconn”
> that it was determined already that corresponding variables contained
> still null pointers.
>
> 1. Thus return directly if
> * the cep state is not the value “ERDMA_EPSTATE_LISTENING”
> or
> * a call of the function “erdma_cep_alloc” failed.
>
> 2. Use more appropriate labels instead.
>
> 3. Delete two questionable checks.
>
> 4. Omit extra initialisations (for the variables “new_cep”, “new_s” and “ret”)
> which became unnecessary with this refactoring.
>
>
> This issue was detected by using the Coccinelle software.
>
> Fixes: 920d93eac8b97778fef48f34f10e58ddf870fc2a ("RDMA/erdma: Add connection management (CM) support")
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/infiniband/hw/erdma/erdma_cm.c | 39 +++++++++++---------------
> 1 file changed, 17 insertions(+), 22 deletions(-)
Same comment as for your RDMA/siw patch.
Thanks
next prev parent reply other threads:[~2023-03-19 11:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <f9303bdc-b1a7-be5e-56c6-dfa8232b8b55@web.de>
[not found] ` <afe30fc6-04c9-528c-f84a-67902b5a6ed8@web.de>
2023-03-19 11:40 ` [PATCH] RDMA/siw: Fix exception handling in siw_accept_newconn() Leon Romanovsky
[not found] ` <1c06e86d-1468-c11a-8344-9563ad6047b5@web.de>
2023-03-19 14:11 ` Leon Romanovsky
[not found] ` <a03c1d04-a41e-7722-c36a-bd6f61094702@web.de>
2023-03-19 17:37 ` Leon Romanovsky
[not found] ` <f0f96f74-21d1-f5bf-1086-1c3ce0ea18f5@web.de>
2023-03-19 11:41 ` Leon Romanovsky [this message]
2023-03-19 13:36 ` [PATCH] RDMA/erdma: Fix exception handling in erdma_accept_newconn() Cheng Xu
2025-03-05 14:20 ` [PATCH] RDMA/erdma: Prevent use-after-free " Markus Elfring
2025-03-06 8:47 ` Leon Romanovsky
2025-03-06 12:06 ` Cheng Xu
[not found] ` <8f785de5-ebe2-edd9-2155-f440acacc643@web.de>
[not found] ` <01af2ec9-4758-1fe6-0d74-b30b95c3e9a5@web.de>
2023-04-09 9:59 ` [PATCH 0/2] IB/uverbs: Adjustments for create_qp() Leon Romanovsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230319114131.GC36557@unreal \
--to=leon@kernel.org \
--cc=Markus.Elfring@web.de \
--cc=chengyou@linux.alibaba.com \
--cc=cocci@inria.fr \
--cc=jgg@ziepe.ca \
--cc=kaishen@linux.alibaba.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=yang.lee@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox