summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@stephanie.cybernetseraph.org>2008-05-27 15:11:25 -0700
committerEric Anholt <eric@anholt.net>2008-05-27 15:11:25 -0700
commitcc7ad27fe414cdf87b7561778a766a012541f116 (patch)
treefa44bff6e7a4d6feb18813319197255eebcf9c4b
parent9a2ae28fbe0e1e5cce0a5d89fbcc84fbdba1206e (diff)
[BSD] Fix lock leak in drm_update_draw malloc failure path.
-rw-r--r--bsd-core/drm_drawable.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/bsd-core/drm_drawable.c b/bsd-core/drm_drawable.c
index 7c443522..268b956c 100644
--- a/bsd-core/drm_drawable.c
+++ b/bsd-core/drm_drawable.c
@@ -136,8 +136,10 @@ int drm_update_draw(struct drm_device *dev, void *data,
if (info->rects == NULL) {
info->rects = drm_alloc(sizeof(*info->rects) *
update->num, DRM_MEM_DRAWABLE);
- if (info->rects == NULL)
+ if (info->rects == NULL) {
+ DRM_SPINUNLOCK(&dev->drw_lock);
return ENOMEM;
+ }
info->num_rects = update->num;
}
/* For some reason the pointer arg is unsigned long long. */