diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/subdev/bios/base.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c index 3a84ad4f171a..70ca7d5a1aa1 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/bios/base.c +++ b/drivers/gpu/drm/nouveau/core/subdev/bios/base.c | |||
@@ -192,7 +192,6 @@ nouveau_bios_shadow_acpi(struct nouveau_bios *bios) | |||
192 | { | 192 | { |
193 | struct pci_dev *pdev = nv_device(bios)->pdev; | 193 | struct pci_dev *pdev = nv_device(bios)->pdev; |
194 | int ret, cnt, i; | 194 | int ret, cnt, i; |
195 | u8 data[3]; | ||
196 | 195 | ||
197 | if (!nouveau_acpi_rom_supported(pdev)) { | 196 | if (!nouveau_acpi_rom_supported(pdev)) { |
198 | bios->data = NULL; | 197 | bios->data = NULL; |
@@ -200,8 +199,13 @@ nouveau_bios_shadow_acpi(struct nouveau_bios *bios) | |||
200 | } | 199 | } |
201 | 200 | ||
202 | bios->size = 0; | 201 | bios->size = 0; |
203 | if (nouveau_acpi_get_bios_chunk(data, 0, 3) == 3) | 202 | bios->data = kmalloc(4096, GFP_KERNEL); |
204 | bios->size = data[2] * 512; | 203 | if (bios->data) { |
204 | if (nouveau_acpi_get_bios_chunk(bios->data, 0, 4096) == 4096) | ||
205 | bios->size = bios->data[2] * 512; | ||
206 | kfree(bios->data); | ||
207 | } | ||
208 | |||
205 | if (!bios->size) | 209 | if (!bios->size) |
206 | return; | 210 | return; |
207 | 211 | ||