diff options
Diffstat (limited to 'net/x25/af_x25.c')
-rw-r--r-- | net/x25/af_x25.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c index 5f03e4ea65bf..3e16c6abde4f 100644 --- a/net/x25/af_x25.c +++ b/net/x25/af_x25.c | |||
@@ -1261,14 +1261,19 @@ static int x25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1261 | struct x25_sock *x25 = x25_sk(sk); | 1261 | struct x25_sock *x25 = x25_sk(sk); |
1262 | struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; | 1262 | struct sockaddr_x25 *sx25 = (struct sockaddr_x25 *)msg->msg_name; |
1263 | size_t copied; | 1263 | size_t copied; |
1264 | int qbit, header_len = x25->neighbour->extended ? | 1264 | int qbit, header_len; |
1265 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN; | ||
1266 | |||
1267 | struct sk_buff *skb; | 1265 | struct sk_buff *skb; |
1268 | unsigned char *asmptr; | 1266 | unsigned char *asmptr; |
1269 | int rc = -ENOTCONN; | 1267 | int rc = -ENOTCONN; |
1270 | 1268 | ||
1271 | lock_sock(sk); | 1269 | lock_sock(sk); |
1270 | |||
1271 | if (x25->neighbour == NULL) | ||
1272 | goto out; | ||
1273 | |||
1274 | header_len = x25->neighbour->extended ? | ||
1275 | X25_EXT_MIN_LEN : X25_STD_MIN_LEN; | ||
1276 | |||
1272 | /* | 1277 | /* |
1273 | * This works for seqpacket too. The receiver has ordered the queue for | 1278 | * This works for seqpacket too. The receiver has ordered the queue for |
1274 | * us! We do one quick check first though | 1279 | * us! We do one quick check first though |