Message ID | 3853b0e4846656a31799dbd4ffb7f57c302980de.1719234744.git.tanggeliang@kylinos.cn |
---|---|
State | New |
Headers | show |
Series | Fixes for BPF selftests on loongarch | expand |
diff --git a/net/core/skmsg.c b/net/core/skmsg.c index fd20aae30be2..bafcc1e2eadf 100644 --- a/net/core/skmsg.c +++ b/net/core/skmsg.c @@ -432,6 +432,8 @@ int sk_msg_recvmsg(struct sock *sk, struct sk_psock *psock, struct msghdr *msg, sge = sk_msg_elem(msg_rx, i); copy = sge->length; page = sg_page(sge); + if (!page) + goto out; if (copied + copy > len) copy = len - copied; copy = copy_page_to_iter(page, sge->offset, copy, iter);