diff options
author | Andrii Simiklit <andrii.simiklit@globallogic.com> | 2019-07-19 17:39:07 +0300 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2019-08-05 15:31:43 +0200 |
commit | dc471f2ef8ffd6dcac170b82724b2e6069797a34 (patch) | |
tree | e26cbf498977680d5c901cc4ccd2ca9e11fb6aac /src | |
parent | 74470baebbdacc8fd31c9912eb8c00c0cd102903 (diff) |
etnaviv: fix a null pointer dereference
This issue was found by cppcheck
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/etnaviv/drm/etnaviv_bo.c | 4 |
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; |