Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
77159b4d
Commit
77159b4d
authored
Aug 31, 2007
by
Steve French
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CIFS] Fix warnings shown by newer version of sparse
Signed-off-by:
Steve French
<
sfrench@us.ibm.com
>
parent
26f57364
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
37 deletions
+32
-37
fs/cifs/connect.c
fs/cifs/connect.c
+28
-33
fs/cifs/dir.c
fs/cifs/dir.c
+1
-1
fs/cifs/inode.c
fs/cifs/inode.c
+2
-2
fs/cifs/link.c
fs/cifs/link.c
+1
-1
No files found.
fs/cifs/connect.c
View file @
77159b4d
...
@@ -2972,36 +2972,32 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
...
@@ -2972,36 +2972,32 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlob
->
DomainName
.
Length
=
0
;
SecurityBlob
->
DomainName
.
Length
=
0
;
SecurityBlob
->
DomainName
.
MaximumLength
=
0
;
SecurityBlob
->
DomainName
.
MaximumLength
=
0
;
}
else
{
}
else
{
__u16
len
=
__u16
ln
=
cifs_strtoUCS
((
__le16
*
)
bcc_ptr
,
domain
,
64
,
cifs_strtoUCS
((
__le16
*
)
bcc_ptr
,
domain
,
64
,
nls_codepage
);
nls_codepage
);
l
e
n
*=
2
;
ln
*=
2
;
SecurityBlob
->
DomainName
.
MaximumLength
=
SecurityBlob
->
DomainName
.
MaximumLength
=
cpu_to_le16
(
l
e
n
);
cpu_to_le16
(
ln
);
SecurityBlob
->
DomainName
.
Buffer
=
SecurityBlob
->
DomainName
.
Buffer
=
cpu_to_le32
(
SecurityBlobLength
);
cpu_to_le32
(
SecurityBlobLength
);
bcc_ptr
+=
len
;
bcc_ptr
+=
ln
;
SecurityBlobLength
+=
len
;
SecurityBlobLength
+=
ln
;
SecurityBlob
->
DomainName
.
Length
=
SecurityBlob
->
DomainName
.
Length
=
cpu_to_le16
(
ln
);
cpu_to_le16
(
len
);
}
}
if
(
user
==
NULL
)
{
if
(
user
==
NULL
)
{
SecurityBlob
->
UserName
.
Buffer
=
0
;
SecurityBlob
->
UserName
.
Buffer
=
0
;
SecurityBlob
->
UserName
.
Length
=
0
;
SecurityBlob
->
UserName
.
Length
=
0
;
SecurityBlob
->
UserName
.
MaximumLength
=
0
;
SecurityBlob
->
UserName
.
MaximumLength
=
0
;
}
else
{
}
else
{
__u16
len
=
__u16
ln
=
cifs_strtoUCS
((
__le16
*
)
bcc_ptr
,
user
,
64
,
cifs_strtoUCS
((
__le16
*
)
bcc_ptr
,
user
,
64
,
nls_codepage
);
nls_codepage
);
l
e
n
*=
2
;
ln
*=
2
;
SecurityBlob
->
UserName
.
MaximumLength
=
SecurityBlob
->
UserName
.
MaximumLength
=
cpu_to_le16
(
l
e
n
);
cpu_to_le16
(
ln
);
SecurityBlob
->
UserName
.
Buffer
=
SecurityBlob
->
UserName
.
Buffer
=
cpu_to_le32
(
SecurityBlobLength
);
cpu_to_le32
(
SecurityBlobLength
);
bcc_ptr
+=
len
;
bcc_ptr
+=
ln
;
SecurityBlobLength
+=
len
;
SecurityBlobLength
+=
ln
;
SecurityBlob
->
UserName
.
Length
=
SecurityBlob
->
UserName
.
Length
=
cpu_to_le16
(
ln
);
cpu_to_le16
(
len
);
}
}
/* SecurityBlob->WorkstationName.Length =
/* SecurityBlob->WorkstationName.Length =
...
@@ -3045,33 +3041,32 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
...
@@ -3045,33 +3041,32 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
SecurityBlob
->
DomainName
.
Length
=
0
;
SecurityBlob
->
DomainName
.
Length
=
0
;
SecurityBlob
->
DomainName
.
MaximumLength
=
0
;
SecurityBlob
->
DomainName
.
MaximumLength
=
0
;
}
else
{
}
else
{
__u16
l
e
n
;
__u16
ln
;
negotiate_flags
|=
NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED
;
negotiate_flags
|=
NTLMSSP_NEGOTIATE_DOMAIN_SUPPLIED
;
strncpy
(
bcc_ptr
,
domain
,
63
);
strncpy
(
bcc_ptr
,
domain
,
63
);
l
e
n
=
strnlen
(
domain
,
64
);
ln
=
strnlen
(
domain
,
64
);
SecurityBlob
->
DomainName
.
MaximumLength
=
SecurityBlob
->
DomainName
.
MaximumLength
=
cpu_to_le16
(
l
e
n
);
cpu_to_le16
(
ln
);
SecurityBlob
->
DomainName
.
Buffer
=
SecurityBlob
->
DomainName
.
Buffer
=
cpu_to_le32
(
SecurityBlobLength
);
cpu_to_le32
(
SecurityBlobLength
);
bcc_ptr
+=
l
e
n
;
bcc_ptr
+=
ln
;
SecurityBlobLength
+=
l
e
n
;
SecurityBlobLength
+=
ln
;
SecurityBlob
->
DomainName
.
Length
=
cpu_to_le16
(
l
e
n
);
SecurityBlob
->
DomainName
.
Length
=
cpu_to_le16
(
ln
);
}
}
if
(
user
==
NULL
)
{
if
(
user
==
NULL
)
{
SecurityBlob
->
UserName
.
Buffer
=
0
;
SecurityBlob
->
UserName
.
Buffer
=
0
;
SecurityBlob
->
UserName
.
Length
=
0
;
SecurityBlob
->
UserName
.
Length
=
0
;
SecurityBlob
->
UserName
.
MaximumLength
=
0
;
SecurityBlob
->
UserName
.
MaximumLength
=
0
;
}
else
{
}
else
{
__u16
l
e
n
;
__u16
ln
;
strncpy
(
bcc_ptr
,
user
,
63
);
strncpy
(
bcc_ptr
,
user
,
63
);
len
=
strnlen
(
user
,
64
);
ln
=
strnlen
(
user
,
64
);
SecurityBlob
->
UserName
.
MaximumLength
=
SecurityBlob
->
UserName
.
MaximumLength
=
cpu_to_le16
(
ln
);
cpu_to_le16
(
len
);
SecurityBlob
->
UserName
.
Buffer
=
SecurityBlob
->
UserName
.
Buffer
=
cpu_to_le32
(
SecurityBlobLength
);
cpu_to_le32
(
SecurityBlobLength
);
bcc_ptr
+=
l
e
n
;
bcc_ptr
+=
ln
;
SecurityBlobLength
+=
l
e
n
;
SecurityBlobLength
+=
ln
;
SecurityBlob
->
UserName
.
Length
=
cpu_to_le16
(
l
e
n
);
SecurityBlob
->
UserName
.
Length
=
cpu_to_le16
(
ln
);
}
}
/* BB fill in our workstation name if known BB */
/* BB fill in our workstation name if known BB */
...
@@ -3138,8 +3133,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
...
@@ -3138,8 +3133,8 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
}
else
{
}
else
{
remaining_words
=
BCC
(
smb_buffer_response
)
/
2
;
remaining_words
=
BCC
(
smb_buffer_response
)
/
2
;
}
}
len
=
len
=
UniStrnlen
((
wchar_t
*
)
bcc_ptr
,
UniStrnlen
((
wchar_t
*
)
bcc_ptr
,
remaining_words
-
1
);
remaining_words
-
1
);
/* We look for obvious messed up bcc or strings in response so we do not go off
/* We look for obvious messed up bcc or strings in response so we do not go off
the end since (at least) WIN2K and Windows XP have a major bug in not null
the end since (at least) WIN2K and Windows XP have a major bug in not null
terminating last Unicode string in response */
terminating last Unicode string in response */
...
@@ -3223,7 +3218,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
...
@@ -3223,7 +3218,7 @@ CIFSNTLMSSPAuthSessSetup(unsigned int xid, struct cifsSesInfo *ses,
<=
BCC
(
smb_buffer_response
))
{
<=
BCC
(
smb_buffer_response
))
{
if
(
ses
->
serverOS
)
if
(
ses
->
serverOS
)
kfree
(
ses
->
serverOS
);
kfree
(
ses
->
serverOS
);
ses
->
serverOS
=
kzalloc
(
len
+
1
,
GFP_KERNEL
);
ses
->
serverOS
=
kzalloc
(
len
+
1
,
GFP_KERNEL
);
strncpy
(
ses
->
serverOS
,
bcc_ptr
,
len
);
strncpy
(
ses
->
serverOS
,
bcc_ptr
,
len
);
bcc_ptr
+=
len
;
bcc_ptr
+=
len
;
...
...
fs/cifs/dir.c
View file @
77159b4d
...
@@ -397,7 +397,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
...
@@ -397,7 +397,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode,
/* BB Do not bother to decode buf since no
/* BB Do not bother to decode buf since no
local inode yet to put timestamps in,
local inode yet to put timestamps in,
but we can reuse it safely */
but we can reuse it safely */
int
bytes_written
;
unsigned
int
bytes_written
;
struct
win_dev
*
pdev
;
struct
win_dev
*
pdev
;
pdev
=
(
struct
win_dev
*
)
buf
;
pdev
=
(
struct
win_dev
*
)
buf
;
if
(
S_ISCHR
(
mode
))
{
if
(
S_ISCHR
(
mode
))
{
...
...
fs/cifs/inode.c
View file @
77159b4d
...
@@ -1478,7 +1478,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
...
@@ -1478,7 +1478,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
atomic_dec
(
&
open_file
->
wrtPending
);
atomic_dec
(
&
open_file
->
wrtPending
);
cFYI
(
1
,
(
"SetFSize for attrs rc = %d"
,
rc
));
cFYI
(
1
,
(
"SetFSize for attrs rc = %d"
,
rc
));
if
((
rc
==
-
EINVAL
)
||
(
rc
==
-
EOPNOTSUPP
))
{
if
((
rc
==
-
EINVAL
)
||
(
rc
==
-
EOPNOTSUPP
))
{
int
bytes_written
;
unsigned
int
bytes_written
;
rc
=
CIFSSMBWrite
(
xid
,
pTcon
,
rc
=
CIFSSMBWrite
(
xid
,
pTcon
,
nfid
,
0
,
attrs
->
ia_size
,
nfid
,
0
,
attrs
->
ia_size
,
&
bytes_written
,
NULL
,
NULL
,
&
bytes_written
,
NULL
,
NULL
,
...
@@ -1511,7 +1511,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
...
@@ -1511,7 +1511,7 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs)
cifs_sb
->
mnt_cifs_flags
&
cifs_sb
->
mnt_cifs_flags
&
CIFS_MOUNT_MAP_SPECIAL_CHR
);
CIFS_MOUNT_MAP_SPECIAL_CHR
);
if
(
rc
==
0
)
{
if
(
rc
==
0
)
{
int
bytes_written
;
unsigned
int
bytes_written
;
rc
=
CIFSSMBWrite
(
xid
,
pTcon
,
rc
=
CIFSSMBWrite
(
xid
,
pTcon
,
netfid
,
0
,
netfid
,
0
,
attrs
->
ia_size
,
attrs
->
ia_size
,
...
...
fs/cifs/link.c
View file @
77159b4d
...
@@ -237,7 +237,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
...
@@ -237,7 +237,7 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen)
char
*
tmp_path
=
NULL
;
char
*
tmp_path
=
NULL
;
char
*
tmpbuffer
;
char
*
tmpbuffer
;
unsigned
char
*
referrals
=
NULL
;
unsigned
char
*
referrals
=
NULL
;
int
num_referrals
=
0
;
unsigned
int
num_referrals
=
0
;
int
len
;
int
len
;
__u16
fid
;
__u16
fid
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment