drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.
authorEric Anholt <eric@anholt.net>
Thu, 9 Feb 2017 17:23:34 +0000 (09:23 -0800)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:45:35 +0000 (15:45 +0100)
commit00568142fc0ac6392e6e9d196d5469b1afb16efc
treea941046f328b64cb564ff1674a400579a0041fe9
parent8890fa4ccb4220595d1fa0c54148755a74221045
drm/vc4: Fix OOPSes from trying to cache a partially constructed BO.

If a CMA allocation failed, the partially constructed BO would be
unreferenced through the normal path, and we might choose to put it in
the BO cache.  If we then reused it before it expired from the cache,
the kernel would OOPS.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: c826a6e10644 ("drm/vc4: Add a BO cache.")
drivers/gpu/drm/vc4/vc4_bo.c