[PATCH 2/3] smb/server: check create_proc_sessions() failure

Ze Tan <[email protected]>
Newsgroups org.kernel.vger.linux-cifs
Message-ID <66350fc01028af59c6cf7976a7fb9040361347cf.1786674373.git.tanze@kylinos.cn>
create_proc_sessions() returns -ENOMEM when its procfs entry
cannot be created.

Fixes: b38f99c1217a ("ksmbd: add procfs interface for runtime monitoring and statistics")
Signed-off-by: Ze Tan <[email protected]>
Reviewed-by: ChenXiaoSong <[email protected]>
---
 fs/smb/server/server.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c
index 0ccd123ba418..14431adce9b8 100644
--- a/fs/smb/server/server.c
+++ b/fs/smb/server/server.c
@@ -623,7 +623,10 @@ static int __init ksmbd_server_init(void)
 	ret = ksmbd_proc_init();
 	if (ret)
 		goto err_unregister;
-	create_proc_sessions();
+	ret = create_proc_sessions();
+	if (ret)
+		goto err_proc_cleanup;
+
 	create_proc_shares();
 
 	ksmbd_server_tcp_callbacks_init();
-- 
2.43.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.