qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] block: remove dead check
@ 2017-01-04 14:59 Paolo Bonzini
  2017-01-04 17:36 ` Eric Blake
  2017-01-12 10:55 ` Michael Tokarev
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2017-01-04 14:59 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial

options must be non-NULL here, because a NULL value is replaced with
qdict_new earlier in the function.  Reported by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block.c b/block.c
index 39ddea3..a0346c8 100644
--- a/block.c
+++ b/block.c
@@ -1851,7 +1851,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
     bdrv_refresh_filename(bs);
 
     /* Check if any unknown options were used */
-    if (options && (qdict_size(options) != 0)) {
+    if (qdict_size(options) != 0) {
         const QDictEntry *entry = qdict_first(options);
         if (flags & BDRV_O_PROTOCOL) {
             error_setg(errp, "Block protocol '%s' doesn't support the option "
-- 
2.9.3

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

* Re: [Qemu-devel] [PATCH] block: remove dead check
  2017-01-04 14:59 [Qemu-devel] [PATCH] block: remove dead check Paolo Bonzini
@ 2017-01-04 17:36 ` Eric Blake
  2017-01-12 10:55 ` Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Blake @ 2017-01-04 17:36 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

[-- Attachment #1: Type: text/plain, Size: 1044 bytes --]

On 01/04/2017 08:59 AM, Paolo Bonzini wrote:
> options must be non-NULL here, because a NULL value is replaced with
> qdict_new earlier in the function.  Reported by Coverity.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Eric Blake <eblake@redhat.com>

> 
> diff --git a/block.c b/block.c
> index 39ddea3..a0346c8 100644
> --- a/block.c
> +++ b/block.c
> @@ -1851,7 +1851,7 @@ static BlockDriverState *bdrv_open_inherit(const char *filename,
>      bdrv_refresh_filename(bs);
>  
>      /* Check if any unknown options were used */
> -    if (options && (qdict_size(options) != 0)) {
> +    if (qdict_size(options) != 0) {
>          const QDictEntry *entry = qdict_first(options);
>          if (flags & BDRV_O_PROTOCOL) {
>              error_setg(errp, "Block protocol '%s' doesn't support the option "
> 

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

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

* Re: [Qemu-devel] [PATCH] block: remove dead check
  2017-01-04 14:59 [Qemu-devel] [PATCH] block: remove dead check Paolo Bonzini
  2017-01-04 17:36 ` Eric Blake
@ 2017-01-12 10:55 ` Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2017-01-12 10:55 UTC (permalink / raw)
  To: Paolo Bonzini, qemu-devel; +Cc: qemu-trivial

04.01.2017 17:59, Paolo Bonzini wrote:
> options must be non-NULL here, because a NULL value is replaced with
> qdict_new earlier in the function.  Reported by Coverity.

Applied to -trivial, thank you!

/mjt

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

end of thread, other threads:[~2017-01-12 10:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-04 14:59 [Qemu-devel] [PATCH] block: remove dead check Paolo Bonzini
2017-01-04 17:36 ` Eric Blake
2017-01-12 10:55 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).