From 1a4b1e4f3ddc85c8197a6182b72f1fdc63417d27 Mon Sep 17 00:00:00 2001 From: Stefan Assmann Date: Thu, 29 Jan 2009 19:56:41 +0000 Subject: [PATCH] Fix fs->vol_name handling This patch checks wether fs->vol_name exists and handles the case where it doesn't exist. That fixes the lockup that occurs when trying to run qemu-system-ppc -cdrom -boot d Signed-off-by: Stefan Assmann git-svn-id: svn://coreboot.org/openbios/openbios-devel@430 f158a5a8-5612-0410-a976-696ce0be7e32 --- modules/filesystems.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/filesystems.c b/modules/filesystems.c index 726bcb9..1d0a674 100644 --- a/modules/filesystems.c +++ b/modules/filesystems.c @@ -145,8 +145,12 @@ files_volume_name( files_info_t *mi ) if( !mi->volname ) mi->volname = malloc( VOLNAME_SIZE ); - - ret = mi->fs->vol_name( mi->fs, mi->volname, VOLNAME_SIZE ); + /* handle case where there is no vol_name function in fs */ + if( !mi->fs->vol_name ) { + mi->volname[0] = '\0'; + ret = mi->volname; + } else + ret = mi->fs->vol_name( mi->fs, mi->volname, VOLNAME_SIZE ); PUSH( (ucell)ret ); }