aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/smbdes.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-02-01 23:21:57 -0500
committerSteve French <sfrench@us.ibm.com>2007-02-01 23:21:57 -0500
commit9a0c8230e84898ed27f790408805e33fa482b2f9 (patch)
tree785eb8b75b4bac6a48f58d8593aa40c2f345d762 /fs/cifs/smbdes.c
parent030e9d8147491a9d2fe1b67882a3720fcf8b95f7 (diff)
[CIFS] Reduce cifs stack space usage
The two cifs functions that used the most stack according to "make checkstack" have been changed to use less stack. Thanks to jra and Shaggy for helpful ideas Signed-off-by: Steve French <sfrench@us.ibm.com> cc: jra@samba.org cc: shaggy@us.ibm.com
Diffstat (limited to 'fs/cifs/smbdes.c')
-rw-r--r--fs/cifs/smbdes.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/cifs/smbdes.c b/fs/cifs/smbdes.c
index 7a1b2b961ec8..1a4a395c9376 100644
--- a/fs/cifs/smbdes.c
+++ b/fs/cifs/smbdes.c
@@ -196,7 +196,7 @@ dohash(char *out, char *in, char *key, int forw)
196 char c[28]; 196 char c[28];
197 char d[28]; 197 char d[28];
198 char *cd; 198 char *cd;
199 char ki[16][48]; 199 char (*ki)[48];
200 char *pd1; 200 char *pd1;
201 char l[32], r[32]; 201 char l[32], r[32];
202 char *rl; 202 char *rl;
@@ -206,6 +206,10 @@ dohash(char *out, char *in, char *key, int forw)
206 if(pk1 == NULL) 206 if(pk1 == NULL)
207 return; 207 return;
208 208
209 ki = kmalloc(16*48, GFP_KERNEL);
210 if(ki == NULL)
211 return;
212
209 cd = pk1 + 56; 213 cd = pk1 + 56;
210 pd1= cd + 56; 214 pd1= cd + 56;
211 rl = pd1 + 64; 215 rl = pd1 + 64;
@@ -243,6 +247,7 @@ dohash(char *out, char *in, char *key, int forw)
243 er = kmalloc(48+48+32+32+32, GFP_KERNEL); 247 er = kmalloc(48+48+32+32+32, GFP_KERNEL);
244 if(er == NULL) { 248 if(er == NULL) {
245 kfree(pk1); 249 kfree(pk1);
250 kfree(ki);
246 return; 251 return;
247 } 252 }
248 erk = er+48; 253 erk = er+48;
@@ -290,6 +295,7 @@ dohash(char *out, char *in, char *key, int forw)
290 295
291 permute(out, rl, perm6, 64); 296 permute(out, rl, perm6, 64);
292 kfree(pk1); 297 kfree(pk1);
298 kfree(ki);
293} 299}
294 300
295static void 301static void