linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Sagi Grimberg <sagi@grimberg.me>
To: Chaitanya Kulkarni <kch@nvidia.com>, hare@suse.de
Cc: hch@lst.de, linux-nvme@lists.infradead.org, kbusch@kernel.org
Subject: Re: [PATCH V3 2/3] nvmet_auth: use common helper for buffer alloc
Date: Tue, 6 Jun 2023 01:02:08 +0300	[thread overview]
Message-ID: <a8431996-516d-2da1-2f9e-1931d69e4d4d@grimberg.me> (raw)
In-Reply-To: <20230605091920.34253-3-kch@nvidia.com>



On 6/5/23 12:19, Chaitanya Kulkarni wrote:
> Add a common helper to factor out buffer allocation in
> nvmet_execute_auth_send() and nvmet_execute_auth_receive() and call it
> from nvmet_auth_common_prep() once we done with the secp/spsp0/spsp1
> check.
> 
> Only functional change in this patch is transfer buffer allocation is
> moved before nvmet_check_transfer_len() and it is freed if when
> nvmet_check_transfer_len() fails. But similar allocation and free is
> used in error unwind path in nvme code and it is not in fast path, so
> it shuold be fine.

This is asking for a future memory leak. It kinda makes sense to
allocate after we run sanity checks on the request...


  reply	other threads:[~2023-06-05 22:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05  9:19 [PATCH V3 0/3] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05  9:19 ` [PATCH V3 1/3] nvmet-auth: use common helper to check secp/spsp Chaitanya Kulkarni
2023-06-05 21:56   ` Sagi Grimberg
2023-06-07 10:59   ` Max Gurtovoy
2023-06-05  9:19 ` [PATCH V3 2/3] nvmet_auth: use common helper for buffer alloc Chaitanya Kulkarni
2023-06-05 22:02   ` Sagi Grimberg [this message]
2023-06-08 12:41     ` Max Gurtovoy
2023-06-05  9:19 ` [PATCH V3 3/3] nvmet-auth: use correct type for status variable Chaitanya Kulkarni
2023-06-05 22:27   ` Sagi Grimberg
2023-06-05  9:24 ` [PATCH V3 0/3] nvmet-auth: auth send / receive cleanup Chaitanya Kulkarni
2023-06-05 22:27   ` Sagi Grimberg

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=a8431996-516d-2da1-2f9e-1931d69e4d4d@grimberg.me \
    --to=sagi@grimberg.me \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=kbusch@kernel.org \
    --cc=kch@nvidia.com \
    --cc=linux-nvme@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).