Skip to contentSkip to conversation

ksmbd: remove unneeded mark_inode_dirty in set_info_sec()

PATCH New Namjae Jeon 1 participant 2 messages Sep 12, 2023

Subsystems (2)
lore
Share & tools
lore

Namjae Jeon

author maintainer
#0 lore raw

PATCH 1/1 ksmbd: remove unneeded mark_inode_dirty in set_info_sec()

mark_inode_dirty will be called in notify_change(). This patch remove unneeded mark_inode_dirty in set_info_sec().

---
 fs/smb/server/smbacl.c | 1 -
 1 file changed, 1 deletion(-)
fs/smb/server/smbacl.c +0 -1
index e5e438bf5499..6c0305be895e 100644
@@ -1420,7 +1420,6 @@ int set_info_sec(struct ksmbd_conn *conn, struct ksmbd_tree_connect *tcon,
 out:
 	posix_acl_release(fattr.cf_acls);
 	posix_acl_release(fattr.cf_dacls);
-	mark_inode_dirty(inode);
 	return rc;
 }
 
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/1 ksmbd: fix passing freed memory 'aux_payload_buf'

The patch e2b76ab8b5c9: "ksmbd: add support for read compound" leads to the following Smatch static checker warning:

fs/smb/server/smb2pdu.c:6329 smb2_read()
warn: passing freed memory 'aux_payload_buf'

It doesn't matter that we're passing a freed variable because nbytes is zero. This patch set "aux_payload_buf = NULL" to make smatch silence.

Fixes e2b76ab8b5c9 ("ksmbd: add support for read compound")
---
 fs/smb/server/smb2pdu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/server/smb2pdu.c +1 -1
index 749660110878..544022dd6d20 100644
@@ -6312,7 +6312,7 @@ int smb2_read(struct ksmbd_work *work)
 						      aux_payload_buf,
 						      nbytes);
 		kvfree(aux_payload_buf);
-
+		aux_payload_buf = NULL;
 		nbytes = 0;
 		if (remain_bytes < 0) {
 			err = (int)remain_bytes;
Signature · 1 line
2.25.1