aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-05-16 16:55:42 +0200
committerPaul Kocialkowski <paul.kocialkowski@bootlin.com>2019-05-23 17:31:42 +0200
commit65f50f9761343d3dcc580db8e36e05d321d7e980 (patch)
tree59166eaf3be423724a8c3d4a514b88457d9bdb6f /drivers/gpu
parentdrm/vc4: Reformat and the binner bo allocation helper (diff)
downloadlinux-dev-65f50f9761343d3dcc580db8e36e05d321d7e980.tar.xz
linux-dev-65f50f9761343d3dcc580db8e36e05d321d7e980.zip
drm/vc4: Check for V3D before binner bo alloc
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
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/vc4/vc4_v3d.c3
1 files changed, 3 insertions, 0 deletions
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