patch-2.1.26 linux/net/socket.c

Next file: linux/net/sysctl_net.c
Previous file: linux/net/rose/rose_dev.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.25/linux/net/socket.c linux/net/socket.c
@@ -645,7 +645,7 @@
 asmlinkage int sys_socketpair(int family, int type, int protocol, int usockvec[2])
 {
 	int fd1, fd2, i;
-	struct socket *sock1, *sock2;
+	struct socket *sock1=NULL, *sock2=NULL;
 	int err;
 
 	lock_kernel();
@@ -700,6 +700,10 @@
 		}
 	}
 out:
+	if(sock1)
+		sockfd_put(sock1);
+	if(sock2)
+		sockfd_put(sock2);
 	unlock_kernel();
 	return err;
 }
@@ -1114,6 +1118,7 @@
 		err=sock->ops->shutdown(sock, how);
 		sockfd_put(sock);
 	}
+	unlock_kernel();
 	return err;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov