All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3()
@ 2020-10-30  2:46 AlexChen
  2020-11-11  7:38 ` Alex Chen
  0 siblings, 1 reply; 3+ messages in thread
From: AlexChen @ 2020-10-30  2:46 UTC (permalink / raw)
  To: jasowang; +Cc: qemu-trivial, zhengchuan, QEMU, zhang.zhanghailiang

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>
---
 net/l2tpv3.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/net/l2tpv3.c b/net/l2tpv3.c
index 55fea17c0f..e4d4218db6 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.19.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3()
  2020-10-30  2:46 [PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3() AlexChen
@ 2020-11-11  7:38 ` Alex Chen
  2020-11-11  8:53   ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Chen @ 2020-11-11  7:38 UTC (permalink / raw)
  To: jasowang; +Cc: qemu-trivial, zhengchuan, QEMU, zhang.zhanghailiang

Kindly ping.

On 2020/10/30 10:46, AlexChen wrote:
> 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>
> ---
>  net/l2tpv3.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/net/l2tpv3.c b/net/l2tpv3.c
> index 55fea17c0f..e4d4218db6 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;
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3()
  2020-11-11  7:38 ` Alex Chen
@ 2020-11-11  8:53   ` Jason Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2020-11-11  8:53 UTC (permalink / raw)
  To: Alex Chen; +Cc: qemu-trivial, zhengchuan, QEMU, zhang.zhanghailiang


On 2020/11/11 下午3:38, Alex Chen wrote:
> Kindly ping.
>
> On 2020/10/30 10:46, AlexChen wrote:
>> 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>
>> ---
>>   net/l2tpv3.c | 9 +++------
>>   1 file changed, 3 insertions(+), 6 deletions(-)


Queued.

Thanks



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-11  8:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-30  2:46 [PATCH] net/l2tpv3: Remove redundant check in net_init_l2tpv3() AlexChen
2020-11-11  7:38 ` Alex Chen
2020-11-11  8:53   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.