diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-11-18 22:18:34 -0500 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-11-25 00:31:21 -0500 |
commit | 954329412ea45ad6b509aa26f1441941fd432823 (patch) | |
tree | 154064166e6a137474bc54111e5e143e9de3911b | |
parent | 950950327bd63b7f54808c7028839a37899035f9 (diff) |
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>
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c index 8b8332e46f24..d5e6938cc6bc 100644 --- a/drivers/gpu/drm/nouveau/nouveau_acpi.c +++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c | |||
@@ -367,6 +367,7 @@ static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios, | |||
367 | return -ENODEV; | 367 | return -ENODEV; |
368 | } | 368 | } |
369 | obj = (union acpi_object *)buffer.pointer; | 369 | obj = (union acpi_object *)buffer.pointer; |
370 | len = min(len, (int)obj->buffer.length); | ||
370 | memcpy(bios+offset, obj->buffer.pointer, len); | 371 | memcpy(bios+offset, obj->buffer.pointer, len); |
371 | kfree(buffer.pointer); | 372 | kfree(buffer.pointer); |
372 | return len; | 373 | return len; |