diff options
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c index 80963d05b54a..1947d6139a38 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bios.c +++ b/drivers/gpu/drm/nouveau/nouveau_bios.c | |||
@@ -273,6 +273,7 @@ bios_shadow(struct drm_device *dev) | |||
273 | mthd->score = score_vbios(bios, mthd->rw); | 273 | mthd->score = score_vbios(bios, mthd->rw); |
274 | mthd->size = bios->length; | 274 | mthd->size = bios->length; |
275 | mthd->data = bios->data; | 275 | mthd->data = bios->data; |
276 | bios->data = NULL; | ||
276 | } while (mthd->score != 3 && (++mthd)->shadow); | 277 | } while (mthd->score != 3 && (++mthd)->shadow); |
277 | 278 | ||
278 | mthd = shadow_methods; | 279 | mthd = shadow_methods; |
@@ -281,7 +282,8 @@ bios_shadow(struct drm_device *dev) | |||
281 | if (mthd->score > best->score) { | 282 | if (mthd->score > best->score) { |
282 | kfree(best->data); | 283 | kfree(best->data); |
283 | best = mthd; | 284 | best = mthd; |
284 | } | 285 | } else |
286 | kfree(mthd->data); | ||
285 | } while ((++mthd)->shadow); | 287 | } while ((++mthd)->shadow); |
286 | 288 | ||
287 | if (best->score) { | 289 | if (best->score) { |