aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/connect.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index c7d341714586..701daf411a4b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -776,7 +776,7 @@ multi_t2_fnd:
776 set_current_state(TASK_RUNNING); 776 set_current_state(TASK_RUNNING);
777 } 777 }
778 778
779 return 0; 779 module_put_and_exit(0);
780} 780}
781 781
782/* extract the host portion of the UNC string */ 782/* extract the host portion of the UNC string */
@@ -2176,10 +2176,17 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
2176 so no need to spinlock this init of tcpStatus */ 2176 so no need to spinlock this init of tcpStatus */
2177 srvTcp->tcpStatus = CifsNew; 2177 srvTcp->tcpStatus = CifsNew;
2178 init_MUTEX(&srvTcp->tcpSem); 2178 init_MUTEX(&srvTcp->tcpSem);
2179
2180 /*
2181 * since we're in a cifs function already, we know that
2182 * this will succeed. No need for try_module_get().
2183 */
2184 __module_get(THIS_MODULE);
2179 srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd"); 2185 srvTcp->tsk = kthread_run((void *)(void *)cifs_demultiplex_thread, srvTcp, "cifsd");
2180 if (IS_ERR(srvTcp->tsk)) { 2186 if (IS_ERR(srvTcp->tsk)) {
2181 rc = PTR_ERR(srvTcp->tsk); 2187 rc = PTR_ERR(srvTcp->tsk);
2182 cERROR(1, ("error %d create cifsd thread", rc)); 2188 cERROR(1, ("error %d create cifsd thread", rc));
2189 module_put(THIS_MODULE);
2183 srvTcp->tsk = NULL; 2190 srvTcp->tsk = NULL;
2184 sock_release(csocket); 2191 sock_release(csocket);
2185 kfree(srvTcp->hostname); 2192 kfree(srvTcp->hostname);