const struct net_protocol *ipprot;
        int protocol = iph->protocol;
 
+       /* Checkin full IP header plus 8 bytes of protocol to
+        * avoid additional coding at protocol handlers.
+        */
+       if (!pskb_may_pull(skb, iph->ihl * 4 + 8))
+               return;
+
        raw_icmp_error(skb, protocol, info);
 
        rcu_read_lock();
                goto out;
        }
 
-       /* Checkin full IP header plus 8 bytes of protocol to
-        * avoid additional coding at protocol handlers.
-        */
-       if (!pskb_may_pull(skb, iph->ihl * 4 + 8))
-               goto out;
-
        icmp_socket_deliver(skb, info);
 
 out: