commit | 6caf6964cd471aaaedccb053ccbf5caabaaaf79d | [log] [tgz] |
---|---|---|
author | Ding Tao <miyatsu@qq.com> | Thu Nov 23 21:52:33 2017 +0800 |
committer | Anas Nashif <nashif@linux.intel.com> | Tue Nov 28 12:28:10 2017 -0500 |
tree | 4e3c97114e0bc98bafa7812997fbf9ff930eceea | |
parent | 21b94bacd99db2f325b9d5050abc799e252283aa [diff] |
net: pkt: Fix possible division by zero When net debugging is enabled, the count variable is initialized to -1. This may cause division by zero if there is only one fragment in pkt. Solve this by setting the count to 0 and checking the value before the print at the end of the function. Successfully tested on STM32F407 SoC. Signed-off-by: Ding Tao <miyatsu@qq.com>