diff --git a/net/ipv4/ping.c b/net/ipv4/ping.c index cf479f2d1e8caead31c133210f591a7ea9bd1eb2..94248624e2616a03542a21c22701497bd1363ddb 100644 --- a/net/ipv4/ping.c +++ b/net/ipv4/ping.c @@ -452,6 +452,8 @@ static int ping_push_pending_frames(struct sock *sk, struct pingfakehdr *pfh, { struct sk_buff *skb = skb_peek(&sk->sk_write_queue); + if (!skb) + return 0; pfh->wcheck = csum_partial((char *)&pfh->icmph, sizeof(struct icmphdr), pfh->wcheck); pfh->icmph.checksum = csum_fold(pfh->wcheck);