]> www.infradead.org Git - users/griffoul/linux.git/commitdiff
cifs: Fix oops due to uninitialised variable
authorDavid Howells <dhowells@redhat.com>
Tue, 19 Aug 2025 15:27:36 +0000 (16:27 +0100)
committerSteve French <stfrench@microsoft.com>
Tue, 19 Aug 2025 16:16:14 +0000 (11:16 -0500)
Fix smb3_init_transform_rq() to initialise buffer to NULL before calling
netfs_alloc_folioq_buffer() as netfs assumes it can append to the buffer it
is given.  Setting it to NULL means it should start a fresh buffer, but the
value is currently undefined.

Fixes: a2906d3316fc ("cifs: Switch crypto buffer to use a folio_queue rather than an xarray")
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Steve French <sfrench@samba.org>
cc: Paulo Alcantara <pc@manguebit.org>
cc: linux-cifs@vger.kernel.org
cc: linux-fsdevel@vger.kernel.org
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2ops.c

index 3b251de874ec2ba4e1814de737affa2d094ec32f..94b1d7a395d50ad14d7d9792cc9fc9823b9aa64e 100644 (file)
@@ -4496,7 +4496,7 @@ smb3_init_transform_rq(struct TCP_Server_Info *server, int num_rqst,
        for (int i = 1; i < num_rqst; i++) {
                struct smb_rqst *old = &old_rq[i - 1];
                struct smb_rqst *new = &new_rq[i];
-               struct folio_queue *buffer;
+               struct folio_queue *buffer = NULL;
                size_t size = iov_iter_count(&old->rq_iter);
 
                orig_len += smb_rqst_len(server, old);