[Qemu-devel] [PATCH 2/4] error: Remove NULL checks on error_propagate() calls

Laurent Vivier posted 4 patches 7 years, 7 months ago
There is a newer version of this series
[Qemu-devel] [PATCH 2/4] error: Remove NULL checks on error_propagate() calls
Posted by Laurent Vivier 7 years, 7 months ago
Re-run Coccinelle patch
scripts/coccinelle/error_propagate_null.cocci

Signed-off-by: Laurent Vivier <lvivier@redhat.com>
---
 io/channel-websock.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/io/channel-websock.c b/io/channel-websock.c
index ec48a305f0..e6608b969d 100644
--- a/io/channel-websock.c
+++ b/io/channel-websock.c
@@ -586,9 +586,7 @@ static gboolean qio_channel_websock_handshake_io(QIOChannel *ioc,
         return TRUE;
     }
 
-    if (err) {
-        error_propagate(&wioc->io_err, err);
-    }
+    error_propagate(&wioc->io_err, err);
 
     trace_qio_channel_websock_handshake_reply(ioc);
     qio_channel_add_watch(
-- 
2.14.3


Re: [Qemu-devel] [PATCH 2/4] error: Remove NULL checks on error_propagate() calls
Posted by Eric Blake 7 years, 7 months ago
On 03/22/2018 11:12 AM, Laurent Vivier wrote:
> Re-run Coccinelle patch
> scripts/coccinelle/error_propagate_null.cocci
> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>   io/channel-websock.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 

Misses an offender in numa.c, why?

https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06382.html

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 2/4] error: Remove NULL checks on error_propagate() calls
Posted by Laurent Vivier 7 years, 7 months ago
On 23/03/2018 21:50, Eric Blake wrote:
> On 03/22/2018 11:12 AM, Laurent Vivier wrote:
>> Re-run Coccinelle patch
>> scripts/coccinelle/error_propagate_null.cocci
>>
>> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
>> ---
>>   io/channel-websock.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
> 
> Misses an offender in numa.c, why?
> 
> https://lists.gnu.org/archive/html/qemu-devel/2018-03/msg06382.html
> 

No, error_report_err() doesn't check if  err is NULL, we must check
before calling it.

Thanks,
Laurent