diff options
author | 2021-09-07 08:15:21 +0900 | |
---|---|---|
committer | 2021-09-08 17:16:09 -0500 | |
commit | 4ffd5264e8ecb20e1826b9474c19738fdecd67e6 (patch) | |
tree | be636d41b4e6072f06e403b33a4c71e0f1297d6e /fs/ksmbd/smb2pdu.c | |
parent | ksmbd: add missing assignments to ret on ndr_read_int64 read calls (diff) | |
download | linux-4ffd5264e8ecb20e1826b9474c19738fdecd67e6.tar.gz linux-4ffd5264e8ecb20e1826b9474c19738fdecd67e6.tar.bz2 linux-4ffd5264e8ecb20e1826b9474c19738fdecd67e6.zip |
ksmbd: fix read of uninitialized variable ret in set_file_basic_info
Addresses-Coverity reported Uninitialized variables warninig :
/fs/ksmbd/smb2pdu.c: 5525 in set_file_basic_info()
5519 if (!rc) {
5520 inode->i_ctime = ctime;
5521 mark_inode_dirty(inode);
5522 }
5523 inode_unlock(inode);
5524 }
>>> CID 1506805: Uninitialized variables (UNINIT)
>>> Using uninitialized value "rc".
5525 return rc;
5526 }
5527
5528 static int set_file_allocation_info(struct ksmbd_work *work,
5529 struct ksmbd_file *fp, char *buf)
5530 {
Addresses-Coverity: ("Uninitialized variable")
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/smb2pdu.c')
-rw-r--r-- | fs/ksmbd/smb2pdu.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index a350e1cef7f4..c86164dc70bb 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -5444,7 +5444,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, struct file *filp; struct inode *inode; struct user_namespace *user_ns; - int rc; + int rc = 0; if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE)) return -EACCES; |