diff options
author | Steve French <smfrench@gmail.com> | 2015-03-26 23:41:59 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2015-04-01 01:01:47 -0400 |
commit | 064bcc0702a83aed29220bee3b3db3f968c5d8ae (patch) | |
tree | a5f6e9f1614b7f0b8c37c29f3097e2f112eb8bb5 | |
parent | 8e3531060556bf5e09444acd2aa5c78bce9c9f70 (diff) |
Fix coverity warning
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 <smfrench@gmail.com>
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Acked-by: Sachin Prabhu <sprabhu@redhat.com>
Reviewed-by: Jeff Layton <jlayton@poochiereds.net>
-rw-r--r-- | fs/cifs/smb2misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index 689f035915cf..22dfdf17d065 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c | |||
@@ -322,7 +322,7 @@ smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr) | |||
322 | 322 | ||
323 | /* return pointer to beginning of data area, ie offset from SMB start */ | 323 | /* return pointer to beginning of data area, ie offset from SMB start */ |
324 | if ((*off != 0) && (*len != 0)) | 324 | if ((*off != 0) && (*len != 0)) |
325 | return hdr->ProtocolId + *off; | 325 | return (char *)(&hdr->ProtocolId[0]) + *off; |
326 | else | 326 | else |
327 | return NULL; | 327 | return NULL; |
328 | } | 328 | } |