Patchwork Clean up assertion in get_boot_devices_list()

login
register
mail settings
Submitter Markus Armbruster
Date Nov. 8, 2011, 9:58 a.m.
Message ID <1320746280-31710-1-git-send-email-armbru@redhat.com>
Download mbox | patch
Permalink /patch/124310/
State New
Headers show

Comments

Markus Armbruster - Nov. 8, 2011, 9:58 a.m.
g_strdup() can't fail, remove assertion.  Assert its argument can't be
null, because that's not obvious (add_boot_device_path() ensures it).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 vl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Anthony Liguori - Nov. 9, 2011, 7:44 p.m.
On 11/08/2011 03:58 AM, Markus Armbruster wrote:
> g_strdup() can't fail, remove assertion.  Assert its argument can't be
> null, because that's not obvious (add_boot_device_path() ensures it).
>
> Signed-off-by: Markus Armbruster<armbru@redhat.com>

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>   vl.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/vl.c b/vl.c
> index 641629b..f169aac 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -915,8 +915,8 @@ char *get_boot_devices_list(uint32_t *size)
>           } else if (devpath) {
>               bootpath = devpath;
>           } else {
> +            assert(i->suffix);
>               bootpath = g_strdup(i->suffix);
> -            assert(bootpath);
>           }
>
>           if (total) {

Patch

diff --git a/vl.c b/vl.c
index 641629b..f169aac 100644
--- a/vl.c
+++ b/vl.c
@@ -915,8 +915,8 @@  char *get_boot_devices_list(uint32_t *size)
         } else if (devpath) {
             bootpath = devpath;
         } else {
+            assert(i->suffix);
             bootpath = g_strdup(i->suffix);
-            assert(bootpath);
         }
 
         if (total) {