Commit 2255397c authored by Steve French's avatar Steve French

smb3: fix potential null dereference in decrypt offload

commit a091c5f67c99 ("smb3: allow parallelizing decryption of reads")
had a potential null dereference
Reported-by: default avatarkbuild test robot <lkp@intel.com>
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Suggested-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 96d9f7ed
...@@ -4055,6 +4055,7 @@ static void smb2_decrypt_offload(struct work_struct *work) ...@@ -4055,6 +4055,7 @@ static void smb2_decrypt_offload(struct work_struct *work)
goto free_pages; goto free_pages;
} }
dw->server->lstrp = jiffies;
mid = smb2_find_mid(dw->server, dw->buf); mid = smb2_find_mid(dw->server, dw->buf);
if (mid == NULL) if (mid == NULL)
cifs_dbg(FYI, "mid not found\n"); cifs_dbg(FYI, "mid not found\n");
...@@ -4063,13 +4064,9 @@ static void smb2_decrypt_offload(struct work_struct *work) ...@@ -4063,13 +4064,9 @@ static void smb2_decrypt_offload(struct work_struct *work)
rc = handle_read_data(dw->server, mid, dw->buf, rc = handle_read_data(dw->server, mid, dw->buf,
dw->server->vals->read_rsp_size, dw->server->vals->read_rsp_size,
dw->ppages, dw->npages, dw->len); dw->ppages, dw->npages, dw->len);
}
dw->server->lstrp = jiffies;
mid->callback(mid); mid->callback(mid);
cifs_mid_q_entry_release(mid); cifs_mid_q_entry_release(mid);
}
free_pages: free_pages:
for (i = dw->npages-1; i >= 0; i--) for (i = dw->npages-1; i >= 0; i--)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment