From: Namjae Jeon linkinjeon@kernel.org
mainline inclusion from mainline-5.15-rc1 commit 4ffd5264e8ecb20e1826b9474c19738fdecd67e6 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I60T7G CVE: NA
Reference: https://git.kernel.org/torvalds/linux/c/4ffd5264e8ec
-------------------------------
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 Signed-off-by: Jason Yan yanaijie@huawei.com Signed-off-by: Zhong Jinghua zhongjinghua@huawei.com --- fs/ksmbd/smb2pdu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ksmbd/smb2pdu.c b/fs/ksmbd/smb2pdu.c index 33e77ef0dbb5..2fa4584df93e 100644 --- a/fs/ksmbd/smb2pdu.c +++ b/fs/ksmbd/smb2pdu.c @@ -5398,7 +5398,7 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, struct timespec64 ctime; struct file *filp; struct inode *inode; - int rc; + int rc = 0;
if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE)) return -EACCES;