提交 12e8a208 编写于 作者: S Steve French

Trivial endian fixes

Some trivial endian fixes for the SMB2 code. One
warning remains which I asked Pavel to look at.
Reviewed-by: NPavel Shilovsky <piastry@etersoft.ru>
Signed-off-by: NSteve French <smfrench@gmail.com>
上级 ba02e899
...@@ -422,7 +422,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server) ...@@ -422,7 +422,8 @@ smb2_is_valid_lease_break(char *buffer, struct TCP_Server_Info *server)
struct cifs_pending_open *open; struct cifs_pending_open *open;
struct smb2_lease_break_work *lw; struct smb2_lease_break_work *lw;
bool found; bool found;
int ack_req = rsp->Flags & SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED; int ack_req = le32_to_cpu(rsp->Flags &
SMB2_NOTIFY_BREAK_LEASE_FLAG_ACK_REQUIRED);
lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL); lw = kmalloc(sizeof(struct smb2_lease_break_work), GFP_KERNEL);
if (!lw) { if (!lw) {
...@@ -524,7 +525,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) ...@@ -524,7 +525,7 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)
if (rsp->hdr.Command != SMB2_OPLOCK_BREAK) if (rsp->hdr.Command != SMB2_OPLOCK_BREAK)
return false; return false;
if (le16_to_cpu(rsp->StructureSize) != if (rsp->StructureSize !=
smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) { smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) {
if (le16_to_cpu(rsp->StructureSize) == 44) if (le16_to_cpu(rsp->StructureSize) == 44)
return smb2_is_valid_lease_break(buffer, server); return smb2_is_valid_lease_break(buffer, server);
......
...@@ -496,7 +496,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length) ...@@ -496,7 +496,7 @@ smb2_is_status_pending(char *buf, struct TCP_Server_Info *server, int length)
{ {
struct smb2_hdr *hdr = (struct smb2_hdr *)buf; struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
if (le32_to_cpu(hdr->Status) != STATUS_PENDING) if (hdr->Status != STATUS_PENDING)
return false; return false;
if (!length) { if (!length) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册