Skip to content

Commit

Permalink
Fix coverity warning
Browse files Browse the repository at this point in the history
Coverity reports a warning for referencing the beginning of the
SMB2/SMB3 frame using the ProtocolId field as an array. Although
it works the same either way, this patch should quiet the warning
and might be a little clearer.

Reported by Coverity (CID 741269)

Signed-off-by: Steve French <[email protected]>
Acked-by: Shirish Pargaonkar <[email protected]>
Acked-by: Sachin Prabhu <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
  • Loading branch information
smfrench committed Apr 1, 2015
1 parent 8e35310 commit 064bcc0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/smb2misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)

/* return pointer to beginning of data area, ie offset from SMB start */
if ((*off != 0) && (*len != 0))
return hdr->ProtocolId + *off;
return (char *)(&hdr->ProtocolId[0]) + *off;
else
return NULL;
}
Expand Down

0 comments on commit 064bcc0

Please sign in to comment.