fix Synchronous Exception on some arm cpus (#2488)

This commit is contained in:
Jianfeng Liu 2023-07-20 10:56:55 +08:00 committed by GitHub
parent 430f81ac49
commit 529541f218
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -342,11 +342,13 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len)
if (len == 0) if (len == 0)
return 0; return 0;
if (file->name) {
if (grub_strncmp(file->name, GRUB_MEMFILE_MEM, grub_strlen(GRUB_MEMFILE_MEM)) == 0) { if (grub_strncmp(file->name, GRUB_MEMFILE_MEM, grub_strlen(GRUB_MEMFILE_MEM)) == 0) {
grub_memcpy(buf, (grub_uint8_t *)(file->data) + file->offset, len); grub_memcpy(buf, (grub_uint8_t *)(file->data) + file->offset, len);
file->offset += len; file->offset += len;
return len; return len;
} }
}
read_hook = file->read_hook; read_hook = file->read_hook;
read_hook_data = file->read_hook_data; read_hook_data = file->read_hook_data;