r600/drm: fix segfaults in winsys create failure path

Would try to destroy radeon->cman, radeon->kman both which were still
NULL.

Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Keith Whitwell 2010-10-14 16:42:38 +01:00 committed by Dave Airlie
parent 4bab22bca3
commit cbf2fb5543

View file

@ -179,9 +179,15 @@ struct radeon *radeon_decref(struct radeon *radeon)
return NULL;
}
radeon->cman->destroy(radeon->cman);
radeon->kman->destroy(radeon->kman);
drmClose(radeon->fd);
if (radeon->cman)
radeon->cman->destroy(radeon->cman);
if (radeon->kman)
radeon->kman->destroy(radeon->kman);
if (radeon->fd >= 0)
drmClose(radeon->fd);
free(radeon);
return NULL;
}