hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/net/kcm/kcmsock.c
....@@ -1064,15 +1064,18 @@
10641064 out_error:
10651065 kcm_push(kcm);
10661066
1067
- if (copied && sock->type == SOCK_SEQPACKET) {
1067
+ if (sock->type == SOCK_SEQPACKET) {
10681068 /* Wrote some bytes before encountering an
10691069 * error, return partial success.
10701070 */
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 {
10751076 kfree_skb(head);
1077
+ kcm->seq_skb = NULL;
1078
+ }
10761079
10771080 err = sk_stream_error(sk, msg->msg_flags, err);
10781081
....@@ -1982,6 +1985,8 @@
19821985 * that all multiplexors and psocks have been destroyed.
19831986 */
19841987 WARN_ON(!list_empty(&knet->mux_list));
1988
+
1989
+ mutex_destroy(&knet->mutex);
19851990 }
19861991
19871992 static struct pernet_operations kcm_net_ops = {