diff options
| author | David Howells <dhowells@redhat.com> | 2026-05-13 19:50:02 +0100 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2026-05-14 13:21:00 -0500 |
| commit | c207f1d785044667f87cc8c72355e33f3981f2d6 (patch) | |
| tree | d1ceb720445dfeebe1fa5194387f6efed8962e93 /fs/smb | |
| parent | 81a874233c305d29e37fdb70b691ff4254294c0b (diff) | |
| download | lwn-c207f1d785044667f87cc8c72355e33f3981f2d6.tar.gz lwn-c207f1d785044667f87cc8c72355e33f3981f2d6.zip | |
smbdirect: Fix error cleanup in smbdirect_map_sges_from_iter()
Fix smbdirect_map_sges_from_iter() to use pre-decrement, not post-decrement
so that it cleans up the correct slots.
Fixes: e5fbdde43017 ("cifs: Add a function to build an RDMA SGE list from an iterator")
Closes: https://sashiko.dev/#/patchset/20260326104544.509518-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Tom Talpey <tom@talpey.com>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb')
| -rw-r--r-- | fs/smb/smbdirect/connection.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smb/smbdirect/connection.c b/fs/smb/smbdirect/connection.c index fe9912e53da6..8adf58097534 100644 --- a/fs/smb/smbdirect/connection.c +++ b/fs/smb/smbdirect/connection.c @@ -2168,7 +2168,7 @@ static ssize_t smbdirect_map_sges_from_iter(struct iov_iter *iter, size_t len, if (ret < 0) { while (state->num_sge > before) { - struct ib_sge *sge = &state->sge[state->num_sge--]; + struct ib_sge *sge = &state->sge[--state->num_sge]; ib_dma_unmap_page(state->device, sge->addr, |
