LINUX: you dont need to memset() after allocating credentials
authorChas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Thu, 7 Jan 2010 23:35:37 +0000 (18:35 -0500)
committerDerrick Brashear <shadow@dementia.org>
Sat, 27 Mar 2010 04:03:15 +0000 (21:03 -0700)
If you wanted to create a blank credential, you wouldn't want to make
it uid = 0.  Anyone allocating a credential SHOULD properly fill in all
fields making this blanking operation moot.  Regardless, this memset()
is before the allocation failure test and would/could panic.

Change-Id: Ia182a874a5e1bf28a2cd94898f67d81e5588d58c
Reviewed-on: http://gerrit.openafs.org/1080
Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/afs/LINUX/osi_cred.c

index 3a0988b..b40d862 100644 (file)
@@ -35,7 +35,6 @@ crget(void)
     cred_t *tmp;
     
     tmp = kmalloc(sizeof(cred_t), GFP_NOFS);
-    memset(tmp, 0, sizeof(cred_t));
     if (!tmp)
         osi_Panic("crget: No more memory for creds!\n");