RE: [PATCH net] tipc: fix division by zero in perc()

From: Tung Quang Nguyen

Date: Fri Nov 06 2026 - 02:47:23 EST


>From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
>
>The perc() function divides count by total without checking whether total is
>zero. When link statistics are queried on a freshly established link that has not
>yet exchanged messages, TIPC_NLA_STATS_MSG_PROF_TOT is zero, causing a
>division by zero in tipc_nl_compat_link_stat_dump().

As sashiko's feedback, this cannot occur because __tipc_nl_add_stats() clamps the value to 1 (as minimum value).

---
pw-bot: rejected