[email protected]
[Top] [All Lists]

PERFORCE change 114873 for review

Subject: PERFORCE change 114873 for review
From: Todd Miller
Date: Fri, 23 Feb 2007 16:38:44 GMT
http://perforce.freebsd.org/chv.cgi?CH=114873

Change 114873 by [email protected]_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);
 }
 
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 114873 for review, Todd Miller <=