Skip to content

Commit c724b2a

Browse files
metze-sambasmfrench
authored andcommitted
smb/client: avoid dereferencing rdata=NULL in smb2_new_read_req()
This happens when called from SMB2_read() while using rdma and reaching the rdma_readwrite_threshold. Cc: [email protected] Fixes: a6559cc ("cifs: split out smb3_use_rdma_offload() helper") Reviewed-by: David Howells <[email protected]> Signed-off-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 5be63fc commit c724b2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4441,7 +4441,7 @@ smb2_new_read_req(void **buf, unsigned int *total_len,
44414441
* If we want to do a RDMA write, fill in and append
44424442
* smbd_buffer_descriptor_v1 to the end of read request
44434443
*/
4444-
if (smb3_use_rdma_offload(io_parms)) {
4444+
if (rdata && smb3_use_rdma_offload(io_parms)) {
44454445
struct smbd_buffer_descriptor_v1 *v1;
44464446
bool need_invalidate = server->dialect == SMB30_PROT_ID;
44474447

0 commit comments

Comments
 (0)