[v8,2/4] drm/vc4: Check for V3D before binner bo alloc

Submitted by Paul Kocialkowski on May 3, 2019, 8:12 a.m.

Details

Message ID 20190503081242.29039-3-paul.kocialkowski@bootlin.com
State New
Headers show
Series "drm/vc4: Binner BO management improvements" ( rev: 7 ) in DRI devel

Not browsing as part of any series.

Commit Message

Paul Kocialkowski May 3, 2019, 8:12 a.m.
Check that we have a V3D device registered before attempting to
allocate a binner buffer object.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
---
 drivers/gpu/drm/vc4/vc4_v3d.c | 3 +++
 1 file changed, 3 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/vc4/vc4_v3d.c b/drivers/gpu/drm/vc4/vc4_v3d.c
index 7c490106e185..c16db4665af6 100644
--- a/drivers/gpu/drm/vc4/vc4_v3d.c
+++ b/drivers/gpu/drm/vc4/vc4_v3d.c
@@ -241,6 +241,9 @@  static int bin_bo_alloc(struct vc4_dev *vc4)
 	int ret = 0;
 	struct list_head list;
 
+	if (!v3d)
+		return -ENODEV;
+
 	/* We may need to try allocating more than once to get a BO
 	 * that doesn't cross 256MB.  Track the ones we've allocated
 	 * that failed so far, so that we can free them when we've got