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

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

Fixes: b02a77726ed0 ("ksmbd: add procfs monitoring for active shares")
Signed-off-by: Ze Tan <[email protected]>
Reviewed-by: ChenXiaoSong <[email protected]>
---
 fs/smb/server/server.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/smb/server/server.c b/fs/smb/server/server.c
index 14431adce9b8..3c318f529927 100644
--- a/fs/smb/server/server.c
+++ b/fs/smb/server/server.c
@@ -627,7 +627,9 @@ static int __init ksmbd_server_init(void)
 	if (ret)
 		goto err_proc_cleanup;
 
-	create_proc_shares();
+	ret = create_proc_shares();
+	if (ret)
+		goto err_proc_cleanup;
 
 	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.