From 19950e29d7f0c02127d14c4ae19fd555d5feb3b7 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 16 Nov 2004 21:59:11 +0000 Subject: [PATCH] 2004-11-16 Marco Gerards * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any property named `name'. Correctly handle the error returned by `grub_ieee1275_finddevice' if a device can not be opened. --- ChangeLog | 6 ++++++ kern/powerpc/ieee1275/openfw.c | 9 +++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08a2468cb..692ebb2da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-11-16 Marco Gerards + + * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any + property named `name'. Correctly handle the error returned by + `grub_ieee1275_finddevice' if a device can not be opened. + 2004-11-02 Hollis Blanchard * term/powerpc/ieee1275/ofconsole.c (grub_ofconsole_readkey): Test diff --git a/kern/powerpc/ieee1275/openfw.c b/kern/powerpc/ieee1275/openfw.c index c60685230..275258c31 100644 --- a/kern/powerpc/ieee1275/openfw.c +++ b/kern/powerpc/ieee1275/openfw.c @@ -103,6 +103,11 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) char devtype[64]; grub_ieee1275_get_property_length (devalias, aliasname, &pathlen); + + /* The property `name' is a special case we should skip. */ + if (!grub_strcmp (aliasname, "name")) + continue; + devpath = grub_malloc (pathlen); if (! devpath) return grub_errno; @@ -113,8 +118,8 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) grub_free (devpath); continue; } - - if (grub_ieee1275_finddevice (devpath, &dev)) + + if (grub_ieee1275_finddevice (devpath, &dev) || dev == -1) { grub_free (devpath); continue;