Skip to contentSkip to conversation

readdir.c-kzalloc

PATCH New [email protected] 1 participant 1 message Apr 16, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 readdir.c-kzalloc

Replacing kmalloc/memset combination with kzalloc.

---

fs/cifs/readdir.c +2 -5
index 2a374d5..512c16b 100644
@@ -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;
Signature · 4 lines
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/kernel-janitors