]> git.baikalelectronics.ru Git - kernel.git/commit
virtchnl: Fix off by one error
authorAlice Michael <alice.michael@intel.com>
Fri, 26 Oct 2018 21:33:31 +0000 (14:33 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Wed, 14 Nov 2018 18:56:33 +0000 (10:56 -0800)
commit9c8805d3505475be47bb2e06f3591e9bfb2cb8d4
tree815fdca8b6ff448ebc254a8250b6c6d3da744b66
parent5fc3316d7ef3f9b519dbf7bf476cdf1513406f53
virtchnl: Fix off by one error

When calculating the valid length for a VIRTCHNL_OP_ENABLE_CHANNELS
message, we accidentally allowed messages with one extra
virtchnl_channel_info structure on the end. This happened due
to an off by one error, because we forgot that valid_len already
accounted for one virtchnl_channel_info structure, so we need to
subtract one from the num_tc value.

Signed-off-by: Alice Michael <alice.michael@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
include/linux/avf/virtchnl.h