qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong
@ 2014-11-12  7:08 SeokYeon Hwang
  2014-11-12  7:35 ` Markus Armbruster
  2014-11-12  8:30 ` Max Reitz
  0 siblings, 2 replies; 3+ messages in thread
From: SeokYeon Hwang @ 2014-11-12  7:08 UTC (permalink / raw)
  To: qemu-devel; +Cc: kongjianjun, paolo.bonzini, armbru, mreitz, SeokYeon Hwang

Added 'assert(os_errno >= 0)' in 'error_set_errno()'.

Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
---
 util/error.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/util/error.c b/util/error.c
index 2ace0d8..6c9d995 100644
--- a/util/error.c
+++ b/util/error.c
@@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
         return;
     }
     assert(*errp == NULL);
+    assert(os_errno >= 0);
 
     err = g_malloc0(sizeof(*err));
 
-- 
2.1.0

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

* Re: [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong
  2014-11-12  7:08 [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong SeokYeon Hwang
@ 2014-11-12  7:35 ` Markus Armbruster
  2014-11-12  8:30 ` Max Reitz
  1 sibling, 0 replies; 3+ messages in thread
From: Markus Armbruster @ 2014-11-12  7:35 UTC (permalink / raw)
  To: SeokYeon Hwang; +Cc: kongjianjun, paolo.bonzini, qemu-devel, mreitz

SeokYeon Hwang <syeon.hwang@samsung.com> writes:

> Added 'assert(os_errno >= 0)' in 'error_set_errno()'.
>
> Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
> ---
>  util/error.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/util/error.c b/util/error.c
> index 2ace0d8..6c9d995 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
>          return;
>      }
>      assert(*errp == NULL);
> +    assert(os_errno >= 0);
>  
>      err = g_malloc0(sizeof(*err));

Too risky for 2.2 at this stage, but fine for 2.3.

Reviewed-by: Markus Armbruster <armbru@redhat.com>

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

* Re: [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong
  2014-11-12  7:08 [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong SeokYeon Hwang
  2014-11-12  7:35 ` Markus Armbruster
@ 2014-11-12  8:30 ` Max Reitz
  1 sibling, 0 replies; 3+ messages in thread
From: Max Reitz @ 2014-11-12  8:30 UTC (permalink / raw)
  To: SeokYeon Hwang, qemu-devel; +Cc: kongjianjun, paolo.bonzini, armbru

On 2014-11-12 at 08:08, SeokYeon Hwang wrote:
> Added 'assert(os_errno >= 0)' in 'error_set_errno()'.
>
> Signed-off-by: SeokYeon Hwang <syeon.hwang@samsung.com>
> ---
>   util/error.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/util/error.c b/util/error.c
> index 2ace0d8..6c9d995 100644
> --- a/util/error.c
> +++ b/util/error.c
> @@ -62,6 +62,7 @@ void error_set_errno(Error **errp, int os_errno, ErrorClass err_class,
>           return;
>       }
>       assert(*errp == NULL);
> +    assert(os_errno >= 0);
>   
>       err = g_malloc0(sizeof(*err));
>   

Reviewed-by: Max Reitz <mreitz@redhat.com>

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

end of thread, other threads:[~2014-11-12  8:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-12  7:08 [Qemu-devel] [PATCH v4] error: passing a negative value to an os_errno is wrong SeokYeon Hwang
2014-11-12  7:35 ` Markus Armbruster
2014-11-12  8:30 ` Max Reitz

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).