smb3: add missing null server pointer check
[linux-2.6-block.git] / fs / smb / client / sess.c
index ed4bd88dd528aab05c9594120116303ca35975e0..476d54fceb50f0319e908ead9f9d25087c906cbd 100644 (file)
@@ -76,7 +76,7 @@ cifs_ses_get_chan_index(struct cifs_ses *ses,
        unsigned int i;
 
        /* if the channel is waiting for termination */
-       if (server->terminate)
+       if (server && server->terminate)
                return CIFS_INVAL_CHAN_INDEX;
 
        for (i = 0; i < ses->chan_count; i++) {