diff
+ static inline void safe_icmpmsgout_inc_stats(struct net *net, unsigned char field)
+ {
+     if (field < 256) {
+         SNMP_INC_STATS_ATOMIC_LONG(net->mib.icmpmsg_statistics, (int)field + 256);
+     } else {
+         pr_warn("Invalid ICMP field: %u\n", field);
+     }
+ }

void icmp_out_count(struct net *net, unsigned char type)
{
-    ICMPMSGOUT_INC_STATS(net, type);
+    safe_icmpmsgout_inc_stats(net, type);
     ICMP_INC_STATS(net, ICMP_MIB_OUTMSGS);
}
