[ovs-git] [openvswitch/ovs] d250e5: netdev-linux: Avoid division by 0 if kernel report...

GitHub noreply at github.com
Mon Aug 20 16:31:18 UTC 2018


  Branch: refs/heads/branch-2.6
  Home:   https://github.com/openvswitch/ovs
  Commit: d250e512f3f5d3d8b2fce7572bf19a2917f95dd1
      https://github.com/openvswitch/ovs/commit/d250e512f3f5d3d8b2fce7572bf19a2917f95dd1
  Author: Ben Pfaff <blp at ovn.org>
  Date:   2018-08-20 (Mon, 20 Aug 2018)

  Changed paths:
    M lib/netdev-linux.c

  Log Message:
  -----------
  netdev-linux: Avoid division by 0 if kernel reports bad scheduler data.

If the kernel reported a value of 0 for the second value in
/proc/net/psched, it would cause a division-by-zero fault in
read_psched().  I don't know of a kernel that would actually do that, but
it's still better to be safe.

Found by clang static analyzer.

Reported-by: Bhargava Shastry <bshastry at sect.tu-berlin.de>
Signed-off-by: Ben Pfaff <blp at ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng at gmail.com>



      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the git mailing list