diff options
author | Steve French <smfrench@gmail.com> | 2013-06-26 17:52:17 -0500 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2013-06-26 17:52:17 -0500 |
commit | 84ceeb9626655ce7c2745f724571ca8008b4695e (patch) | |
tree | d48ed4839aa5f74017cc0b9a11c208053ba331b6 /fs | |
parent | 52dfb446dbc1915e1df89f8ea9cae1fee7ab3d5e (diff) | |
download | linux-84ceeb9626655ce7c2745f724571ca8008b4695e.tar.bz2 |
[CIFS] fix static checker warning
Dan Carpenter wrote:
The patch 7f420cee8bd6: "[CIFS] Charge at least one credit, if server
says that it supports multicredit" from Jun 23, 2013, leads to the
following Smatch complaint:
fs/cifs/smb2pdu.c:120 smb2_hdr_assemble()
warn: variable dereferenced before check 'tcon->ses' (see line 115)
CC: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/smb2pdu.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index f9b74daf962a..53275bf1e0a8 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -111,7 +111,8 @@ smb2_hdr_assemble(struct smb2_hdr *hdr, __le16 smb2_cmd /* command */ , /* BB FIXME when we do write > 64K add +1 for every 64K in req or rsp */ /* GLOBAL_CAP_LARGE_MTU will only be set if dialect > SMB2.02 */ /* See sections 2.2.4 and 3.2.4.1.5 of MS-SMB2 */ - if (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU) + if ((tcon->ses) && + (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_LARGE_MTU)) hdr->CreditCharge = cpu_to_le16(1); /* else CreditCharge MBZ */ |