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>
Sun, 8 Oct 2017 01:00:21 +0000 (01:00 +0000)
commit94f398391a9c24d7405fc4f8ff47d85a8dbd230f
tree6eafe5b3f1c1a987bde5855bf0b7c05f021fd099
parent336b77c57941fee21d20b0facd56d643954d0f0e
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