aboutsummaryrefslogtreecommitdiffstats
path: root/src/etnaviv/drm
diff options
context:
space:
mode:
authorAndrii Simiklit <[email protected]>2019-07-19 17:39:07 +0300
committerLucas Stach <[email protected]>2019-08-05 15:31:43 +0200
commitdc471f2ef8ffd6dcac170b82724b2e6069797a34 (patch)
treee26cbf498977680d5c901cc4ccd2ca9e11fb6aac /src/etnaviv/drm
parent74470baebbdacc8fd31c9912eb8c00c0cd102903 (diff)
etnaviv: fix a null pointer dereference
This issue was found by cppcheck Signed-off-by: Andrii Simiklit <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/etnaviv/drm')
-rw-r--r--src/etnaviv/drm/etnaviv_bo.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/etnaviv/drm/etnaviv_bo.c b/src/etnaviv/drm/etnaviv_bo.c
index 6e952fa4785..2b1fbbbc3c7 100644
--- a/src/etnaviv/drm/etnaviv_bo.c
+++ b/src/etnaviv/drm/etnaviv_bo.c
@@ -238,11 +238,11 @@ out_unlock:
/* destroy a buffer object */
void etna_bo_del(struct etna_bo *bo)
{
- struct etna_device *dev = bo->dev;
-
if (!bo)
return;
+ struct etna_device *dev = bo->dev;
+
if (!p_atomic_dec_zero(&bo->refcnt))
return;