From ad8eb0ed01d96cc16cdafd3b48c0f0cd73d315b4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 May 2008 14:12:51 -0700 Subject: [FreeBSD] Convert from drm_device_t to struct drm_device for consistency. --- bsd-core/drm_drawable.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'bsd-core/drm_drawable.c') diff --git a/bsd-core/drm_drawable.c b/bsd-core/drm_drawable.c index fb318d47..7c443522 100644 --- a/bsd-core/drm_drawable.c +++ b/bsd-core/drm_drawable.c @@ -56,7 +56,7 @@ RB_GENERATE_STATIC(drawable_tree, bsd_drm_drawable_info, tree, drm_drawable_compare); struct drm_drawable_info * -drm_get_drawable_info(drm_device_t *dev, int handle) +drm_get_drawable_info(struct drm_device *dev, int handle) { struct bsd_drm_drawable_info find, *result; @@ -66,7 +66,7 @@ drm_get_drawable_info(drm_device_t *dev, int handle) return &result->info; } -int drm_adddraw(drm_device_t *dev, void *data, struct drm_file *file_priv) +int drm_adddraw(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_draw_t *draw = data; struct bsd_drm_drawable_info *info; @@ -87,7 +87,7 @@ int drm_adddraw(drm_device_t *dev, void *data, struct drm_file *file_priv) return 0; } -int drm_rmdraw(drm_device_t *dev, void *data, struct drm_file *file_priv) +int drm_rmdraw(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_draw_t *draw = (drm_draw_t *)data; struct drm_drawable_info *info; @@ -108,7 +108,8 @@ int drm_rmdraw(drm_device_t *dev, void *data, struct drm_file *file_priv) } } -int drm_update_draw(drm_device_t *dev, void *data, struct drm_file *file_priv) +int drm_update_draw(struct drm_device *dev, void *data, + struct drm_file *file_priv) { struct drm_drawable_info *info; struct drm_update_draw *update = (struct drm_update_draw *)data; -- cgit v1.2.3 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/drm_drawable.c') 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