[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 13/17] net/l2tpv3: Remove redundant check in net_init_l2tpv3()
From: |
Jason Wang |
Subject: |
[PULL 13/17] net/l2tpv3: Remove redundant check in net_init_l2tpv3() |
Date: |
Wed, 11 Nov 2020 21:11:37 +0800 |
From: AlexChen <alex.chen@huawei.com>
The result has been checked to be NULL before, it cannot be NULL here,
so the check is redundant. Remove it.
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: AlexChen <alex.chen@huawei.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
net/l2tpv3.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 55fea17..e4d4218 100644
--- a/net/l2tpv3.c
+++ b/net/l2tpv3.c
@@ -655,9 +655,8 @@ int net_init_l2tpv3(const Netdev *netdev,
error_setg(errp, "could not bind socket err=%i", errno);
goto outerr;
}
- if (result) {
- freeaddrinfo(result);
- }
+
+ freeaddrinfo(result);
memset(&hints, 0, sizeof(hints));
@@ -686,9 +685,7 @@ int net_init_l2tpv3(const Netdev *netdev,
memcpy(s->dgram_dst, result->ai_addr, result->ai_addrlen);
s->dst_size = result->ai_addrlen;
- if (result) {
- freeaddrinfo(result);
- }
+ freeaddrinfo(result);
if (l2tpv3->has_counter && l2tpv3->counter) {
s->has_counter = true;
--
2.7.4
- [PULL 02/17] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup, (continued)
- [PULL 02/17] net/filter-rewriter: destroy g_hash_table in colo_rewriter_cleanup, Jason Wang, 2020/11/11
- [PULL 04/17] Reduce the time of checkpoint for COLO, Jason Wang, 2020/11/11
- [PULL 06/17] colo-compare: fix missing compare_seq initialization, Jason Wang, 2020/11/11
- [PULL 07/17] colo-compare: check mark in mutual exclusion, Jason Wang, 2020/11/11
- [PULL 03/17] Optimize seq_sorter function for colo-compare, Jason Wang, 2020/11/11
- [PULL 05/17] Fix the qemu crash when guest shutdown in COLO mode, Jason Wang, 2020/11/11
- [PULL 08/17] net/colo-compare.c: Fix compare_timeout format issue, Jason Wang, 2020/11/11
- [PULL 09/17] net/colo-compare.c: Change the timer clock type, Jason Wang, 2020/11/11
- [PULL 10/17] net/colo-compare.c: Add secondary old packet detection, Jason Wang, 2020/11/11
- [PULL 11/17] net/colo-compare.c: Increase default queued packet scan frequency, Jason Wang, 2020/11/11
- [PULL 13/17] net/l2tpv3: Remove redundant check in net_init_l2tpv3(),
Jason Wang <=
- [PULL 12/17] net: remove an assert call in eth_get_gso_type, Jason Wang, 2020/11/11
- [PULL 14/17] hw/net/can/ctucan: Don't allow guest to write off end of tx_buffer, Jason Wang, 2020/11/11
- [PULL 15/17] hw/net/can/ctucan: Avoid unused value in ctucan_send_ready_buffers(), Jason Wang, 2020/11/11
- [PULL 16/17] hw/net/can/ctucan_core: Handle big-endian hosts, Jason Wang, 2020/11/11
- [PULL 17/17] hw/net/can/ctucan_core: Use stl_le_p to write to tx_buffers, Jason Wang, 2020/11/11
- Re: [PULL 00/17] Net patches, Peter Maydell, 2020/11/11