PERFORCE change 117208 for review

John Baldwin jhb at FreeBSD.org
Mon Apr 2 19:02:02 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=117208

Change 117208 by jhb at jhb_mutex on 2007/04/02 19:01:15

	Don't call soclose() on the sockets during failure once the file
	descriptors are fully constructed.

Affected files ...

.. //depot/projects/smpng/sys/kern/uipc_syscalls.c#100 edit

Differences ...

==== //depot/projects/smpng/sys/kern/uipc_syscalls.c#100 (text+ko) ====

@@ -664,6 +664,7 @@
 	fp2->f_ops = &socketops;
 	fp2->f_type = DTYPE_SOCKET;
 	FILE_UNLOCK(fp2);
+	so1 = so2 = NULL;
 	error = copyout(sv, uap->rsv, 2 * sizeof (int));
 	if (error)
 		goto free4;
@@ -677,9 +678,11 @@
 	fdclose(fdp, fp1, sv[0], td);
 	fdrop(fp1, td);
 free2:
-	(void)soclose(so2);
+	if (so2 != NULL)
+		(void)soclose(so2);
 free1:
-	(void)soclose(so1);
+	if (so1 != NULL)
+		(void)soclose(so1);
 done2:
 	NET_UNLOCK_GIANT();
 	return (error);


More information about the p4-projects mailing list