Merge tag 'mmc-4.2-rc3' of git://git.linaro.org/people/ulf.hansson/mmc
[firefly-linux-kernel-4.4.55.git] / net / rose / af_rose.c
index 8ae603069a1a1706982dc0b7affd5443cb912308..129d357d27229f4f819c2e104c913cd04be4a28e 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;