Commit a47c397b authored by Pavel Skripkin's avatar Pavel Skripkin Committed by David S. Miller
Browse files

revert "net: kcm: fix memory leak in kcm_sendmsg"



In commit c47cc304 ("net: kcm: fix memory leak in kcm_sendmsg")
I misunderstood the root case of the memory leak and came up with
completely broken fix.

So, simply revert this commit to avoid GPF reported by
syzbot.

Im so sorry for this situation.

Fixes: c47cc304 ("net: kcm: fix memory leak in kcm_sendmsg")
Reported-by: default avatar <syzbot+65badd5e74ec62cb67dc@syzkaller.appspotmail.com>
Signed-off-by: default avatarPavel Skripkin <paskripkin@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent aaab3076
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -1066,11 +1066,6 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
		goto partial_message;
	}

	if (skb_has_frag_list(head)) {
		kfree_skb_list(skb_shinfo(head)->frag_list);
		skb_shinfo(head)->frag_list = NULL;
	}

	if (head != kcm->seq_skb)
		kfree_skb(head);