l2tp: check ps->sock before running pppol2tp_session_ioctl()
[pandora-kernel.git] / net / l2tp / l2tp_ppp.c
index d6dcff6..5a068c5 100644 (file)
@@ -997,6 +997,9 @@ static int pppol2tp_session_ioctl(struct l2tp_session *session,
               session->name, cmd, arg);
 
        sk = ps->sock;
+       if (!sk)
+               return -EBADR;
+
        sock_hold(sk);
 
        switch (cmd) {