drm/vc4: Check for V3D before binner bo alloc
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 16 May 2019 14:55:42 +0000 (16:55 +0200)
committerPaul Kocialkowski <paul.kocialkowski@bootlin.com>
Thu, 23 May 2019 15:31:42 +0000 (17:31 +0200)
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>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190516145544.29051-3-paul.kocialkowski@bootlin.com
drivers/gpu/drm/vc4/vc4_v3d.c

index 7c49010..c16db46 100644 (file)
@@ -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