These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / net / rose / af_rose.c
index 8ae6030..129d357 100644 (file)
@@ -192,7 +192,8 @@ static void rose_kill_by_device(struct net_device *dev)
 
                if (rose->device == dev) {
                        rose_disconnect(s, ENETUNREACH, ROSE_OUT_OF_ORDER, 0);
-                       rose->neighbour->use--;
+                       if (rose->neighbour)
+                               rose->neighbour->use--;
                        rose->device = NULL;
                }
        }
@@ -520,7 +521,7 @@ static int rose_create(struct net *net, struct socket *sock, int protocol,
        if (sock->type != SOCK_SEQPACKET || protocol != 0)
                return -ESOCKTNOSUPPORT;
 
-       sk = sk_alloc(net, PF_ROSE, GFP_ATOMIC, &rose_proto);
+       sk = sk_alloc(net, PF_ROSE, GFP_ATOMIC, &rose_proto, kern);
        if (sk == NULL)
                return -ENOMEM;
 
@@ -559,7 +560,7 @@ static struct sock *rose_make_new(struct sock *osk)
        if (osk->sk_type != SOCK_SEQPACKET)
                return NULL;
 
-       sk = sk_alloc(sock_net(osk), PF_ROSE, GFP_ATOMIC, &rose_proto);
+       sk = sk_alloc(sock_net(osk), PF_ROSE, GFP_ATOMIC, &rose_proto, 0);
        if (sk == NULL)
                return NULL;