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 <iso> -boot d

Signed-off-by: Stefan Assmann <sassmann@suse.de>


git-svn-id: svn://coreboot.org/openbios/openbios-devel@430 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Stefan Assmann
2009-01-29 19:56:41 +00:00
committed by Blue Swirl
parent bf6f68f96f
commit 1a4b1e4f3d

View File

@@ -145,8 +145,12 @@ files_volume_name( files_info_t *mi )
if( !mi->volname ) if( !mi->volname )
mi->volname = malloc( VOLNAME_SIZE ); mi->volname = malloc( VOLNAME_SIZE );
/* handle case where there is no vol_name function in fs */
ret = mi->fs->vol_name( mi->fs, mi->volname, VOLNAME_SIZE ); 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 ); PUSH( (ucell)ret );
} }