]> git.baikalelectronics.ru Git - kernel.git/commit
nouveau/bios: Fix tracking of BIOS image data
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 2 Apr 2012 03:38:19 +0000 (13:38 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Apr 2012 10:06:33 +0000 (11:06 +0100)
commit1d6a2711d19761d88eff0ebbe7cc30ada7bb7853
tree5ec7d22876848e194036c019aaea9f6a14e63c2a
parent679ae16ac43ac362eeb5e721ac5a1aa5bafac5c1
nouveau/bios: Fix tracking of BIOS image data

The code tries various methods for retreiving the BIOS data. However
it doesn't clear the bios->data pointer between the iterations.

In some cases, the shadow() method will fail and not update bios->data
at all, which will cause us to "score" the old data and incorrectly
attribute that score to the new method. This can cause double frees
later when disposing of the unused data.

Additionally, we were not freeing the data for methods that fail the
score test (we only freed when a "best" is superseeded, not when the
new method has a lower score than the exising "best"). Fix that as well.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bios.c