--- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3315,7 +3315,7 @@ static int smb3_fiemap(struct cifs_tcon if (rc) goto out; - if (out_data_len < sizeof(struct file_allocated_range_buffer)) { + if (out_data_len && out_data_len < sizeof(struct file_allocated_range_buffer)) { rc = -EINVAL; goto out; }