[KJ][PATCH]readdir.c-kzalloc

vignesh.babu at wipro.com vignesh.babu at wipro.com
Mon Apr 16 06:05:41 GMT 2007


Replacing kmalloc/memset combination with kzalloc.

Signed-off-by: vignesh babu <vignesh.babu at wipro.com>
---
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 2a374d5..512c16b 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -432,14 +432,11 @@ static int initiate_cifs_search(const int xid, struct file *file)
 
 	if(file->private_data == NULL) {
 		file->private_data = 
-			kmalloc(sizeof(struct cifsFileInfo),GFP_KERNEL);
+			kzalloc(sizeof(struct cifsFileInfo),GFP_KERNEL);
 	}
 
-	if(file->private_data == NULL) {
+	if(file->private_data == NULL)
 		return -ENOMEM;
-	} else {
-		memset(file->private_data,0,sizeof(struct cifsFileInfo));
-	}
 	cifsFile = file->private_data;
 	cifsFile->invalidHandle = TRUE;
 	cifsFile->srch_inf.endOfSearch = FALSE;

-- 
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3173 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20070416/6ed952e1/smime.bin


More information about the samba-technical mailing list