diff --git a/ChangeLog b/ChangeLog index 778c824f3..afb2d5386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2012-05-03 Vladimir Serbinenko + + * grub-core/fs/xfs.c (grub_xfs_iterate_dir): Handle read_inode errors. + 2012-05-03 Vladimir Serbinenko * grub-core/fs/xfs.c (GRUB_XFS_EXTENT_BLOCK): Fix bitmask. diff --git a/grub-core/fs/xfs.c b/grub-core/fs/xfs.c index a3503e652..448f5f340 100644 --- a/grub-core/fs/xfs.c +++ b/grub-core/fs/xfs.c @@ -456,19 +456,28 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, const char *filename) { struct grub_fshelp_node *fdiro; + grub_err_t err; fdiro = grub_malloc (sizeof (struct grub_fshelp_node) - sizeof (struct grub_xfs_inode) + (1 << diro->data->sblock.log2_inode)); if (!fdiro) - return 0; + { + grub_print_error (); + return 0; + } /* The inode should be read, otherwise the filetype can not be determined. */ fdiro->ino = ino; fdiro->inode_read = 1; fdiro->data = diro->data; - grub_xfs_read_inode (diro->data, ino, &fdiro->inode); + err = grub_xfs_read_inode (diro->data, ino, &fdiro->inode); + if (err) + { + grub_print_error (); + return 0; + } return hook (filename, grub_xfs_mode_to_filetype (fdiro->inode.mode),