From owner-p4-projects@FreeBSD.ORG Fri Feb 23 16:38:45 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 3A4D416A410; Fri, 23 Feb 2007 16:38:45 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 00B7016A405 for ; Fri, 23 Feb 2007 16:38:45 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id E57A613C4A3 for ; Fri, 23 Feb 2007 16:38:44 +0000 (UTC) (envelope-from millert@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id l1NGcit5031687 for ; Fri, 23 Feb 2007 16:38:44 GMT (envelope-from millert@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id l1NGcimm031684 for perforce@freebsd.org; Fri, 23 Feb 2007 16:38:44 GMT (envelope-from millert@freebsd.org) Date: Fri, 23 Feb 2007 16:38:44 GMT Message-Id: <200702231638.l1NGcimm031684@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to millert@freebsd.org using -f From: Todd Miller To: Perforce Change Reviews Cc: Subject: PERFORCE change 114873 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Feb 2007 16:38:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=114873 Change 114873 by millert@millert_macbook on 2007/02/23 16:38:38 Check for NULL return from labelh_new() when called with canblock == 0. Affected files ... .. //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.c#13 edit Differences ... ==== //depot/projects/trustedbsd/sedarwin8/darwin/xnu/osfmk/ipc/ipc_labelh.c#13 (text+ko) ==== @@ -118,6 +118,8 @@ ipc_labelh_t lh; lh = (ipc_labelh_t)zalloc_canblock(ipc_labelh_zone, canblock); + if (lh == NULL) + return (NULL); lh_lock_init(lh); lh->lh_port = ipc_port_alloc_kernel(); lh->lh_type = LABELH_TYPE_KERN; @@ -137,10 +139,12 @@ ipc_labelh_t lh; lh = labelh_new(0); - ip_lock(lh->lh_port); - mac_task_label_init(&lh->lh_label); - mac_task_label_copy(&old->lh_label, &lh->lh_label); - ip_unlock(lh->lh_port); + if (lh != NULL) { + ip_lock(lh->lh_port); + mac_task_label_init(&lh->lh_label); + mac_task_label_copy(&old->lh_label, &lh->lh_label); + ip_unlock(lh->lh_port); + } return (lh); }