diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-11-19 13:18:34 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-11-25 15:29:18 +1000 |
commit | 610a2fab06a897ef8da1921128f0a44daa30f946 (patch) | |
tree | 9bf523695265f1d9e4091691f6c7b09476cd2b99 | |
parent | 4400e8a1a69043c3c0356287428d9f140dfa7c2e (diff) | |
download | nouveau-610a2fab06a897ef8da1921128f0a44daa30f946.tar.gz |
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-- | drm/nouveau/nouveau_acpi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drm/nouveau/nouveau_acpi.c b/drm/nouveau/nouveau_acpi.c index 8b8332e46..d5e6938cc 100644 --- a/drm/nouveau/nouveau_acpi.c +++ b/drm/nouveau/nouveau_acpi.c @@ -367,6 +367,7 @@ static int nouveau_rom_call(acpi_handle rom_handle, uint8_t *bios, return -ENODEV; } obj = (union acpi_object *)buffer.pointer; + len = min(len, (int)obj->buffer.length); memcpy(bios+offset, obj->buffer.pointer, len); kfree(buffer.pointer); return len; |