[PATCH] nbd: use kmalloc instead of kzalloc when allocating recv_thread_args

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As all the members of recv_thread_args will be set before queue_work(),
we don't need to use kzalloc() here.

Signed-off-by: Yafang Shao <laoar.shao@xxxxxxxxx>
---
 drivers/block/nbd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index 08696f5..1656a60 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -983,7 +983,7 @@ static int nbd_reconnect_socket(struct nbd_device *nbd, unsigned long arg)
 	if (!sock)
 		return err;
 
-	args = kzalloc(sizeof(*args), GFP_KERNEL);
+	args = kmalloc(sizeof(*args), GFP_KERNEL);
 	if (!args) {
 		sockfd_put(sock);
 		return -ENOMEM;
@@ -1166,7 +1166,7 @@ static int nbd_start_device(struct nbd_device *nbd)
 	for (i = 0; i < num_connections; i++) {
 		struct recv_thread_args *args;
 
-		args = kzalloc(sizeof(*args), GFP_KERNEL);
+		args = kmalloc(sizeof(*args), GFP_KERNEL);
 		if (!args) {
 			sock_shutdown(nbd);
 			return -ENOMEM;
-- 
1.8.3.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux