RDMA/ionic: unmap query QP buffers with their mapped size
Subsystems (2)
PATCH 1/1 RDMA/ionic: unmap query QP buffers with their mapped size
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.
--- drivers/infiniband/hw/ionic/ionic_controlpath.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/ionic/ionic_controlpath.c +2 -2
@@ -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);
Signature · 1 line
2.53.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 8 lines
ionic_query_qp_cmd()mapsquery_sqbufandquery_rqbufwithPAGE_SIZEbut unmaps them withsizeof(*query_sqbuf)andsizeof(*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 <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Leon Romanovsky
AppliedQuoted 8 lines · Thomas Fourier
ionic_query_qp_cmd()mapsquery_sqbufandquery_rqbufwithPAGE_SIZEbut unmaps them withsizeof(*query_sqbuf)andsizeof(*query_rqbuf). This may lead to leaving part of the buffer mapped.Unmap both buffers with
PAGE_SIZE.[...]
Applied, thanks!
[1/1] RDMA/ionic: unmap query QP buffers with their mapped size
https://git.kernel.org/rdma/rdma/c/dbdfbc3279f441
Best regards,
Signature · 1 line
Leon Romanovsky <[email protected]>