All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Fourier <fourier.thomas@gmail.com>
Cc: Thomas Fourier <fourier.thomas@gmail.com>,
	Abhijit Gangurde <abhijit.gangurde@amd.com>,
	Allen Hubbe <allen.hubbe@amd.com>, Jason Gunthorpe <jgg@ziepe.ca>,
	Leon Romanovsky <leon@kernel.org>,
	Andrew Boyer <andrew.boyer@amd.com>,
	linux-rdma@vger.kernel.org (open list:AMD PENSANDO RDMA DRIVER)
Subject: [PATCH] RDMA/ionic: unmap query QP buffers with their mapped size
Date: Tue,  1 Dec 2026 10:35:41 +0100	[thread overview]
Message-ID: <20261201093543.6922-2-fourier.thomas@gmail.com> (raw)

ionic_query_qp_cmd() maps query_sqbuf and query_rqbuf with PAGE_SIZE but
unmaps them with sizeof(*query_sqbuf) and sizeof(*query_rqbuf). This may
lead to leaving part of the buffer mapped.

Unmap both buffers with PAGE_SIZE.

Fixes: e8521822c733 ("RDMA/ionic: Register device ops for control path")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
 drivers/infiniband/hw/ionic/ionic_controlpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/infiniband/hw/ionic/ionic_controlpath.c b/drivers/infiniband/hw/ionic/ionic_controlpath.c
index e85c382f9140..a6f8699f8d2c 100644
--- a/drivers/infiniband/hw/ionic/ionic_controlpath.c
+++ b/drivers/infiniband/hw/ionic/ionic_controlpath.c
@@ -1801,10 +1801,10 @@ static int ionic_query_qp_cmd(struct ionic_ibdev *dev,
 		kfree(hdr_buf);
 	}
 err_hdrbuf:
-	dma_unmap_single(dev->lif_cfg.hwdev, query_rqdma, sizeof(*query_rqbuf),
+	dma_unmap_single(dev->lif_cfg.hwdev, query_rqdma, PAGE_SIZE,
 			 DMA_FROM_DEVICE);
 err_rqdma:
-	dma_unmap_single(dev->lif_cfg.hwdev, query_sqdma, sizeof(*query_sqbuf),
+	dma_unmap_single(dev->lif_cfg.hwdev, query_sqdma, PAGE_SIZE,
 			 DMA_FROM_DEVICE);
 err_sqdma:
 	kfree(query_rqbuf);
-- 
2.53.0


             reply	other threads:[~2026-12-01  9:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01  9:35 Thomas Fourier [this message]
2026-12-01  9:45 ` [PATCH] RDMA/ionic: unmap query QP buffers with their mapped size sashiko-bot

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=20261201093543.6922-2-fourier.thomas@gmail.com \
    --to=fourier.thomas@gmail.com \
    --cc=abhijit.gangurde@amd.com \
    --cc=allen.hubbe@amd.com \
    --cc=andrew.boyer@amd.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.