patch-1.3.82 linux/net/netrom/af_netrom.c

Next file: linux/net/netrom/sysctl_net_netrom.c
Previous file: linux/net/netrom/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.81/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
@@ -266,7 +266,7 @@
 		add_timer(&sk->timer);
 	} else {
 		kfree_s(sk->nr, sizeof(*sk->nr));
-		kfree_s(sk, sizeof(*sk));
+		sk_free(sk);
 	}
 
 	restore_flags(flags);
@@ -415,11 +415,11 @@
 	if (sock->type != SOCK_SEQPACKET || protocol != 0)
 		return -ESOCKTNOSUPPORT;
 
-	if ((sk = (struct sock *)kmalloc(sizeof(*sk), GFP_ATOMIC)) == NULL)
+	if ((sk = sk_alloc(GFP_ATOMIC)) == NULL)
 		return -ENOMEM;
 
 	if ((nr = (nr_cb *)kmalloc(sizeof(*nr), GFP_ATOMIC)) == NULL) {
-		kfree_s(sk, sizeof(*sk));
+		sk_free(sk);
 		return -ENOMEM;
 	}
 
@@ -516,11 +516,11 @@
 	if (osk->type != SOCK_SEQPACKET)
 		return NULL;
 
-	if ((sk = (struct sock *)kmalloc(sizeof(*sk), GFP_ATOMIC)) == NULL)
+	if ((sk = (struct sock *)sk_alloc(GFP_ATOMIC)) == NULL)
 		return NULL;
 
 	if ((nr = (nr_cb *)kmalloc(sizeof(*nr), GFP_ATOMIC)) == NULL) {
-		kfree_s(sk, sizeof(*sk));
+		sk_free(sk);
 		return NULL;
 	}
 
@@ -814,7 +814,7 @@
 	struct sk_buff *skb;
 
 	if (newsock->data)
-		kfree_s(newsock->data, sizeof(struct sock));
+		sk_free(newsock->data);
 
 	newsock->data = NULL;
 	

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this