aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/sess.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-08-30 18:09:15 -0400
committerSteve French <sfrench@us.ibm.com>2007-08-30 18:09:15 -0400
commit26f57364d7cdef9d7ebe27c931fff5e4f21ffb1c (patch)
tree28f991e3ea9e87244312015398f5f25d2eee4405 /fs/cifs/sess.c
parentf01d5e14e764b14b6bf5512678523d009254b209 (diff)
[CIFS] formatting cleanup found by checkpatch
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/sess.c')
-rw-r--r--fs/cifs/sess.c27
1 files changed, 10 insertions, 17 deletions
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 892be9b4d1f3..78797c0e076c 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -67,9 +67,8 @@ static __u32 cifs_ssetup_hdr(struct cifsSesInfo *ses, SESSION_SETUP_ANDX *pSMB)
67 pSMB->req.hdr.Flags2 |= SMBFLG2_DFS; 67 pSMB->req.hdr.Flags2 |= SMBFLG2_DFS;
68 capabilities |= CAP_DFS; 68 capabilities |= CAP_DFS;
69 } 69 }
70 if (ses->capabilities & CAP_UNIX) { 70 if (ses->capabilities & CAP_UNIX)
71 capabilities |= CAP_UNIX; 71 capabilities |= CAP_UNIX;
72 }
73 72
74 /* BB check whether to init vcnum BB */ 73 /* BB check whether to init vcnum BB */
75 return capabilities; 74 return capabilities;
@@ -203,14 +202,11 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
203 if (len >= words_left) 202 if (len >= words_left)
204 return rc; 203 return rc;
205 204
206 if (ses->serverOS) 205 kfree(ses->serverOS);
207 kfree(ses->serverOS);
208 /* UTF-8 string will not grow more than four times as big as UCS-16 */ 206 /* UTF-8 string will not grow more than four times as big as UCS-16 */
209 ses->serverOS = kzalloc(4 * len, GFP_KERNEL); 207 ses->serverOS = kzalloc(4 * len, GFP_KERNEL);
210 if (ses->serverOS != NULL) { 208 if (ses->serverOS != NULL)
211 cifs_strfromUCS_le(ses->serverOS, (__le16 *)data, len, 209 cifs_strfromUCS_le(ses->serverOS, (__le16 *)data, len, nls_cp);
212 nls_cp);
213 }
214 data += 2 * (len + 1); 210 data += 2 * (len + 1);
215 words_left -= len + 1; 211 words_left -= len + 1;
216 212
@@ -220,8 +216,7 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
220 if (len >= words_left) 216 if (len >= words_left)
221 return rc; 217 return rc;
222 218
223 if (ses->serverNOS) 219 kfree(ses->serverNOS);
224 kfree(ses->serverNOS);
225 ses->serverNOS = kzalloc(4 * len, GFP_KERNEL); /* BB this is wrong length FIXME BB */ 220 ses->serverNOS = kzalloc(4 * len, GFP_KERNEL); /* BB this is wrong length FIXME BB */
226 if (ses->serverNOS != NULL) { 221 if (ses->serverNOS != NULL) {
227 cifs_strfromUCS_le(ses->serverNOS, (__le16 *)data, len, 222 cifs_strfromUCS_le(ses->serverNOS, (__le16 *)data, len,
@@ -240,8 +235,7 @@ static int decode_unicode_ssetup(char **pbcc_area, int bleft,
240 if (len > words_left) 235 if (len > words_left)
241 return rc; 236 return rc;
242 237
243 if (ses->serverDomain) 238 kfree(ses->serverDomain);
244 kfree(ses->serverDomain);
245 ses->serverDomain = kzalloc(2 * (len + 1), GFP_KERNEL); /* BB FIXME wrong length */ 239 ses->serverDomain = kzalloc(2 * (len + 1), GFP_KERNEL); /* BB FIXME wrong length */
246 if (ses->serverDomain != NULL) { 240 if (ses->serverDomain != NULL) {
247 cifs_strfromUCS_le(ses->serverDomain, (__le16 *)data, len, 241 cifs_strfromUCS_le(ses->serverDomain, (__le16 *)data, len,
@@ -271,8 +265,7 @@ static int decode_ascii_ssetup(char **pbcc_area, int bleft,
271 if (len >= bleft) 265 if (len >= bleft)
272 return rc; 266 return rc;
273 267
274 if (ses->serverOS) 268 kfree(ses->serverOS);
275 kfree(ses->serverOS);
276 269
277 ses->serverOS = kzalloc(len + 1, GFP_KERNEL); 270 ses->serverOS = kzalloc(len + 1, GFP_KERNEL);
278 if (ses->serverOS) 271 if (ses->serverOS)
@@ -289,8 +282,7 @@ static int decode_ascii_ssetup(char **pbcc_area, int bleft,
289 if (len >= bleft) 282 if (len >= bleft)
290 return rc; 283 return rc;
291 284
292 if (ses->serverNOS) 285 kfree(ses->serverNOS);
293 kfree(ses->serverNOS);
294 286
295 ses->serverNOS = kzalloc(len + 1, GFP_KERNEL); 287 ses->serverNOS = kzalloc(len + 1, GFP_KERNEL);
296 if (ses->serverNOS) 288 if (ses->serverNOS)
@@ -479,7 +471,8 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time,
479 if (ses->capabilities & CAP_UNICODE) { 471 if (ses->capabilities & CAP_UNICODE) {
480 if (iov[0].iov_len % 2) { 472 if (iov[0].iov_len % 2) {
481 *bcc_ptr = 0; 473 *bcc_ptr = 0;
482 } bcc_ptr++; 474 bcc_ptr++;
475 }
483 unicode_ssetup_strings(&bcc_ptr, ses, nls_cp); 476 unicode_ssetup_strings(&bcc_ptr, ses, nls_cp);
484 } else 477 } else
485 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp); 478 ascii_ssetup_strings(&bcc_ptr, ses, nls_cp);