]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netat/adsp_stream.c
xnu-792.2.4.tar.gz
[apple/xnu.git] / bsd / netat / adsp_stream.c
index 8dd2ec37434efa34f6660506bada4eda145a01a1..13811b3a8e48bbd43ada0eb3fbde32fd5cb8f774 100644 (file)
@@ -339,7 +339,12 @@ int adsp_wput(gref, mp)
        int s;
        gbuf_t *xm;
        ioc_t *iocbp;
-       CCBPtr sp = (CCBPtr)gbuf_rptr(((gbuf_t *)gref->info));
+       CCBPtr sp;
+       
+       if (gref->info)
+               sp = (CCBPtr)gbuf_rptr(((gbuf_t *)gref->info));
+       else
+               sp = 0;
 
        if (gbuf_type(mp) == MSG_IOCTL) {
                iocbp = (ioc_t *)gbuf_rptr(mp);
@@ -419,7 +424,7 @@ int adsp_wput(gref, mp)
                case DDP_IOC_GET_CFG:
                        /* respond to an DDP_IOC_GET_CFG sent on an adsp fd */
                        if (((xm = gbuf_cont(mp)) == NULL) &&
-                           (xm = gbuf_alloc(sizeof(at_inet_t), PRI_MED)) == NULL) {
+                           (xm = gbuf_alloc(sizeof(ddp_addr_t), PRI_MED)) == NULL) {
                            iocbp->ioc_rval = -1;
                            adsp_iocnak(gref, mp, ENOBUFS);
                            return 0;
@@ -535,7 +540,7 @@ adspAssignSocket(gref, flag)
        int s;
 
        sMax = flag ? DDP_SOCKET_LAST-46 : DDP_SOCKET_LAST-6;
-       sMin = DDP_SOCKET_1st_DYNAMIC-64;
+       sMin = DDP_SOCKET_1st_DYNAMIC;
 
        ATDISABLE(s, adspall_lock);
        for (inputC=255, sVal=sMax; sVal >= sMin; sVal--) {