From owner-svn-src-stable@FreeBSD.ORG Sun Sep 9 07:38:16 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7344A1065673; Sun, 9 Sep 2012 07:38:16 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E5628FC0A; Sun, 9 Sep 2012 07:38:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q897cGhX026699; Sun, 9 Sep 2012 07:38:16 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q897cGid026697; Sun, 9 Sep 2012 07:38:16 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201209090738.q897cGid026697@svn.freebsd.org> From: Martin Matuska Date: Sun, 9 Sep 2012 07:38:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r240258 - stable/9/sys/cddl/compat/opensolaris/sys X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Sep 2012 07:38:16 -0000 Author: mm Date: Sun Sep 9 07:38:15 2012 New Revision: 240258 URL: http://svn.freebsd.org/changeset/base/240258 Log: MFC r240162: Make r230454 more readable and vendor-like. PR: kern/171380 Modified: stable/9/sys/cddl/compat/opensolaris/sys/sid.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/sid.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/sid.h Sun Sep 9 07:23:15 2012 (r240257) +++ stable/9/sys/cddl/compat/opensolaris/sys/sid.h Sun Sep 9 07:38:15 2012 (r240258) @@ -30,7 +30,8 @@ #define _OPENSOLARIS_SYS_SID_H_ typedef struct ksiddomain { - char kd_name[1]; /* Domain part of SID */ + char *kd_name; /* Domain part of SID */ + uint_t kd_len; } ksiddomain_t; typedef void ksid_t; @@ -38,8 +39,12 @@ static __inline ksiddomain_t * ksid_lookupdomain(const char *domain) { ksiddomain_t *kd; + size_t len; - kd = kmem_alloc(sizeof(*kd) + strlen(domain), KM_SLEEP); + len = strlen(domain) + 1; + kd = kmem_alloc(sizeof(*kd), KM_SLEEP); + kd->kd_len = (uint_t)len; + kd->kd_name = kmem_alloc(len, KM_SLEEP); strcpy(kd->kd_name, domain); return (kd); } @@ -48,6 +53,7 @@ static __inline void ksiddomain_rele(ksiddomain_t *kd) { + kmem_free(kd->kd_name, kd->kd_len); kmem_free(kd, sizeof(*kd)); }