Skip to content

Commit 9543294

Browse files
author
Ben Skeggs
committed
drm/nouveau/bios: return actual size of the buffer retrieved via _ROM
Fixes detection of a failed attempt at fetching the entire ROM image in one-shot (a violation of the spec, that works a lot of the time). Tested on a HP Zbook 15 G2. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
1 parent 9509503 commit 9543294

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/gpu/drm/nouveau/nouveau_acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios,
367367
return -ENODEV;
368368
}
369369
obj = (union acpi_object *)buffer.pointer;
370+
len = min(len, (int)obj->buffer.length);
370371
memcpy(bios+offset, obj->buffer.pointer, len);
371372
kfree(buffer.pointer);
372373
return len;

0 commit comments

Comments
 (0)