From a89880255e23893fa6158bf00a23efbc53685d1a Mon Sep 17 00:00:00 2001 From: Jeff Layton Date: Mon, 1 Dec 2008 07:09:35 -0500 Subject: [PATCH] --- yaml --- r: 121469 b: refs/heads/master c: 0468a2cf914e79442b8309ce62e3f861599d8cab h: refs/heads/master i: 121467: 2bb18e21631123596ac89ab04faac8f013886319 v: v3 --- [refs] | 2 +- trunk/fs/cifs/connect.c | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index e38d80402f4a..6448928a9e87 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 80909022ce966191e6140fcc15d8aff57a7df32e +refs/heads/master: 0468a2cf914e79442b8309ce62e3f861599d8cab diff --git a/trunk/fs/cifs/connect.c b/trunk/fs/cifs/connect.c index c7d341714586..701daf411a4b 100644 --- a/trunk/fs/cifs/connect.c +++ b/trunk/fs/cifs/connect.c @@ -776,7 +776,7 @@ cifs_demultiplex_thread(struct TCP_Server_Info *server) set_current_state(TASK_RUNNING); } - return 0; + module_put_and_exit(0); } /* extract the host portion of the UNC string */ @@ -2176,10 +2176,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb, so no need to spinlock this init of tcpStatus */ srvTcp->tcpStatus = CifsNew; init_MUTEX(&srvTcp->tcpSem); + + /* + * since we're in a cifs function already, we know that + * this will succeed. No need for try_module_get(). + */ + __module_get(THIS_MODULE); srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd"); if (IS_ERR(srvTcp->tsk)) { rc = PTR_ERR(srvTcp->tsk); cERROR(1, ("error %d create cifsd thread", rc)); + module_put(THIS_MODULE); srvTcp->tsk = NULL; sock_release(csocket); kfree(srvTcp->hostname);