Author: dumbbell Date: Sun Aug 25 10:04:10 2013 New Revision: 254838 URL: http://svnweb.freebsd.org/changeset/base/254838
Log: drm: In drm_gem_name_create(), verify argument before acquiring lock Submitted by: J.R. Oldroyd <j...@opal.com> Modified: head/sys/dev/drm2/drm_gem_names.c Modified: head/sys/dev/drm2/drm_gem_names.c ============================================================================== --- head/sys/dev/drm2/drm_gem_names.c Sun Aug 25 10:01:59 2013 (r254837) +++ head/sys/dev/drm2/drm_gem_names.c Sun Aug 25 10:04:10 2013 (r254838) @@ -132,12 +132,12 @@ drm_gem_name_create(struct drm_gem_names { struct drm_gem_name *np; - np = malloc(sizeof(struct drm_gem_name), M_GEM_NAMES, M_WAITOK); - mtx_lock(&names->lock); if (*name != 0) { - mtx_unlock(&names->lock); return (EALREADY); } + + np = malloc(sizeof(struct drm_gem_name), M_GEM_NAMES, M_WAITOK); + mtx_lock(&names->lock); np->name = alloc_unr(names->unr); if (np->name == -1) { mtx_unlock(&names->lock); _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"