aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorShao Miller <shao.miller@yrdsb.edu.on.ca>2011-09-03 15:40:45 -0400
committerPaulo Alcantara <pcacjr@gmail.com>2011-09-11 04:10:00 +0000
commit5b7ccf9012802cbacdf835dd260e510c8fda944b (patch)
treead687683d8ed7e1907e6ef0cc58026b372f7e914 /core
parent779ee27626e1d39ec02b91eb2e8fbcfd48d3bf00 (diff)
downloadsyslinux-5b7ccf9012802cbacdf835dd260e510c8fda944b.tar.gz
syslinux-5b7ccf9012802cbacdf835dd260e510c8fda944b.tar.xz
syslinux-5b7ccf9012802cbacdf835dd260e510c8fda944b.zip
ntfs: Check for disk read error during FS probing
If reading the NTFS BIOS parameter block fails for any reason, we will not attempt to continue to work towards finding an NTFS filesystem on the disk/partition. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: Paulo Alcantara <pcacjr@gmail.com>
Diffstat (limited to 'core')
-rw-r--r--core/fs/ntfs/ntfs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/fs/ntfs/ntfs.c b/core/fs/ntfs/ntfs.c
index 86d2e406..03dec41d 100644
--- a/core/fs/ntfs/ntfs.c
+++ b/core/fs/ntfs/ntfs.c
@@ -1125,12 +1125,15 @@ err_mrec:
/* Initialize the filesystem metadata and return blk size in bits */
static int ntfs_fs_init(struct fs_info *fs)
{
+ int read_count;
struct ntfs_bpb ntfs;
struct ntfs_sb_info *sbi;
struct disk *disk = fs->fs_dev->disk;
uint8_t mft_record_shift;
- disk->rdwr_sectors(disk, &ntfs, 0, 1, 0);
+ read_count = disk->rdwr_sectors(disk, &ntfs, 0, 1, 0);
+ if (!read_count)
+ return -1;
/* sanity check */
if (!ntfs_check_sb_fields(&ntfs))