Thread (9 messages) flat view 9 messages, 4 authors, 2021-02-22
STALE2010d

[PATCH] net/qrtr: replaced useless kzalloc with kmalloc in qrtr_tun_write_iter()

From: Sabyrzhan Tasbolatov <hidden>
Date: 2021-02-04 09:11:58
Also in: lkml
Subsystem: networking [general], qualcomm ipc router (qrtr) driver, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Manivannan Sadhasivam, Linus Torvalds

Replaced kzalloc() with kmalloc(), there is no need for zeroed-out
memory for simple void *kbuf.
For potential, separate clean up - this is followed 
by copy_from_iter_full(len) kzalloc() can probably 
be replaced by kmalloc()?
quoted
 	if (!kbuf)
 		return -ENOMEM;
Signed-off-by: Sabyrzhan Tasbolatov <redacted>
---
 net/qrtr/tun.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/qrtr/tun.c b/net/qrtr/tun.c
index b238c40a9984..9b607c7614de 100644
--- a/net/qrtr/tun.c
+++ b/net/qrtr/tun.c
@@ -86,7 +86,7 @@ static ssize_t qrtr_tun_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	if (len > KMALLOC_MAX_SIZE)
 		return -ENOMEM;
 
-	kbuf = kzalloc(len, GFP_KERNEL);
+	kbuf = kmalloc(len, GFP_KERNEL);
 	if (!kbuf)
 		return -ENOMEM;
 
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help