From cc7ad27fe414cdf87b7561778a766a012541f116 Mon Sep 17 00:00:00 2001 From: Owain Ainsworth Date: Tue, 27 May 2008 15:11:25 -0700 Subject: [BSD] Fix lock leak in drm_update_draw malloc failure path. --- bsd-core/drm_drawable.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'bsd-core') 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. */ -- cgit v1.2.3