Skip to contentSkip to conversation

epoll: use kmalloc() in ep_alloc()

PATCH New Namhyung Kim 1 participant 1 message Jan 12, 2011 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 epoll: use kmalloc() in ep_alloc()

Use kmalloc() instead of kzalloc() in ep_alloc(). It seems that no need to zero-initialize struct eventpoll simply because all of the fields in the struct will be set properly right after.

The struct might contain paddings in it but IMHO it would not be a problem since it will not be accessed from the outside of epoll code.

---
 fs/eventpoll.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/eventpoll.c +1 -1
index 2e21fb85b8b6..bdea67ed9762 100644
@@ -728,7 +728,7 @@ static int ep_alloc(struct eventpoll **pep)
 
 	user = get_current_user();
 	error = -ENOMEM;
-	ep = kzalloc(sizeof(*ep), GFP_KERNEL);
+	ep = kmalloc(sizeof(*ep), GFP_KERNEL);
 	if (unlikely(!ep))
 		goto free_uid;
 
Signature · 1 line
1.7.3.4.600.g982838b0