[PATCH] io_uring/net: Remove unneeded if check in io_net_vec_assign()

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

 



kfree() already checks if its argument is NULL. Remove the unneeded if
check and fix the following Coccinelle/coccicheck warning reported by
ifnullfree.cocci:

  WARNING: NULL check before some freeing functions is not needed

Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxxx>
---
 io_uring/net.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/io_uring/net.c b/io_uring/net.c
index d08abcca89cc..9f35f1eb54cb 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -189,8 +189,7 @@ static int io_net_vec_assign(struct io_kiocb *req, struct io_async_msghdr *kmsg,
 	if (iov) {
 		req->flags |= REQ_F_NEED_CLEANUP;
 		kmsg->free_iov_nr = kmsg->msg.msg_iter.nr_segs;
-		if (kmsg->free_iov)
-			kfree(kmsg->free_iov);
+		kfree(kmsg->free_iov);
 		kmsg->free_iov = iov;
 	}
 	return 0;
-- 
2.46.0





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux