minigbm: fix map time assertions

We should assert when the refcount is equal to zero as well.

BUG=chromium:764871
TEST=gbmtest passes

Change-Id: Iaf8b5bd4bf51472ad7c564341b42a7079b58bd6e
Reviewed-on: https://chromium-review.googlesource.com/758143
Commit-Ready: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
This commit is contained in:
Gurchetan Singh 2017-11-07 17:21:58 -08:00 committed by chrome-bot
parent 3e9d3830dc
commit 425173a0c8

4
drv.c
View file

@ -458,7 +458,7 @@ int drv_bo_invalidate(struct bo *bo, struct map_info *data)
{
int ret = 0;
assert(data);
assert(data->refcount >= 0);
assert(data->refcount > 0);
if (bo->drv->backend->bo_invalidate)
ret = bo->drv->backend->bo_invalidate(bo, data);
@ -470,7 +470,7 @@ int drv_bo_flush(struct bo *bo, struct map_info *data)
{
int ret = 0;
assert(data);
assert(data->refcount >= 0);
assert(data->refcount > 0);
assert(!(bo->use_flags & BO_USE_PROTECTED));
if (bo->drv->backend->bo_flush)