diff options
author | Dave Airlie <airlied@redhat.com> | 2020-09-17 12:54:24 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-09-18 06:14:00 +1000 |
commit | 0b988ca1c7c4c73983b4ea96ef7c2af2263c87eb (patch) | |
tree | 729ee7adfc399e41f03a768f1a1df8f036d7af88 /drivers/gpu/drm/nouveau/nouveau_bo.c | |
parent | 67d6a8b358eac488112a4775f77dc3dbf63bea88 (diff) | |
download | linux-0b988ca1c7c4c73983b4ea96ef7c2af2263c87eb.tar.bz2 |
drm/ttm: protect against reentrant bind in the drivers
This moves the generic tracking into the drivers and protects
against reentrancy in the drivers. It fixes up radeon and agp
to be able to query the bound status as that is required.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200917043040.146575-2-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index aea201d9c513..616d8844ba97 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -718,7 +718,10 @@ nouveau_ttm_tt_bind(struct ttm_bo_device *bdev, struct ttm_tt *ttm, { #if IS_ENABLED(CONFIG_AGP) struct nouveau_drm *drm = nouveau_bdev(bdev); - +#endif + if (!reg) + return -EINVAL; +#if IS_ENABLED(CONFIG_AGP) if (drm->agp.bridge) return ttm_agp_bind(ttm, reg); #endif |