.. | .. |
---|
1064 | 1064 | out_error: |
---|
1065 | 1065 | kcm_push(kcm); |
---|
1066 | 1066 | |
---|
1067 | | - if (copied && sock->type == SOCK_SEQPACKET) { |
---|
| 1067 | + if (sock->type == SOCK_SEQPACKET) { |
---|
1068 | 1068 | /* Wrote some bytes before encountering an |
---|
1069 | 1069 | * error, return partial success. |
---|
1070 | 1070 | */ |
---|
1071 | | - goto partial_message; |
---|
1072 | | - } |
---|
1073 | | - |
---|
1074 | | - if (head != kcm->seq_skb) |
---|
| 1071 | + if (copied) |
---|
| 1072 | + goto partial_message; |
---|
| 1073 | + if (head != kcm->seq_skb) |
---|
| 1074 | + kfree_skb(head); |
---|
| 1075 | + } else { |
---|
1075 | 1076 | kfree_skb(head); |
---|
| 1077 | + kcm->seq_skb = NULL; |
---|
| 1078 | + } |
---|
1076 | 1079 | |
---|
1077 | 1080 | err = sk_stream_error(sk, msg->msg_flags, err); |
---|
1078 | 1081 | |
---|
.. | .. |
---|
1982 | 1985 | * that all multiplexors and psocks have been destroyed. |
---|
1983 | 1986 | */ |
---|
1984 | 1987 | WARN_ON(!list_empty(&knet->mux_list)); |
---|
| 1988 | + |
---|
| 1989 | + mutex_destroy(&knet->mutex); |
---|
1985 | 1990 | } |
---|
1986 | 1991 | |
---|
1987 | 1992 | static struct pernet_operations kcm_net_ops = { |
---|