summaryrefslogtreecommitdiffstats
path: root/fs/cifs/smbdes.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-02-02 04:21:57 +0000
committerSteve French <sfrench@us.ibm.com>2007-02-02 04:21:57 +0000
commit9a0c8230e84898ed27f790408805e33fa482b2f9 (patch)
tree785eb8b75b4bac6a48f58d8593aa40c2f345d762 /fs/cifs/smbdes.c
parent030e9d8147491a9d2fe1b67882a3720fcf8b95f7 (diff)
downloadlinux-9a0c8230e84898ed27f790408805e33fa482b2f9.tar.gz
linux-9a0c8230e84898ed27f790408805e33fa482b2f9.tar.bz2
linux-9a0c8230e84898ed27f790408805e33fa482b2f9.zip
[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)
char c[28];
char d[28];
char *cd;
- char ki[16][48];
+ char (*ki)[48];
char *pd1;
char l[32], r[32];
char *rl;
@@ -206,6 +206,10 @@ dohash(char *out, char *in, char *key, int forw)
if(pk1 == NULL)
return;
+ ki = kmalloc(16*48, GFP_KERNEL);
+ if(ki == NULL)
+ return;
+
cd = pk1 + 56;
pd1= cd + 56;
rl = pd1 + 64;
@@ -243,6 +247,7 @@ dohash(char *out, char *in, char *key, int forw)
er = kmalloc(48+48+32+32+32, GFP_KERNEL);
if(er == NULL) {
kfree(pk1);
+ kfree(ki);
return;
}
erk = er+48;
@@ -290,6 +295,7 @@ dohash(char *out, char *in, char *key, int forw)
permute(out, rl, perm6, 64);
kfree(pk1);
+ kfree(ki);
}
static void