raw/ifpga/base: check file length
authorWei Huang <wei.huang@intel.com>
Wed, 17 Mar 2021 08:21:35 +0000 (04:21 -0400)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 1 Apr 2021 11:52:28 +0000 (13:52 +0200)
commitbf95921a01acc341442cb42c4764c05334e4412b
treeaa6c2c78923bedf38486113ec822fddf9bbe34f5
parent226ecdea99ce2ad4e1554b50fc7c2c4ca069191f
raw/ifpga/base: check file length

In fpga_update_flash(), "smgr->rsu_length" is passed to a
parameter that cannot be negative. So return value of
function "lseek" should be checked before being assigned
to "smgr->rsu_length".

Coverity issue: 367481
Fixes: a05bd1b40bde ("raw/ifpga: add FPGA RSU APIs")

Signed-off-by: Wei Huang <wei.huang@intel.com>
Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>
Acked-by: Rosen Xu <rosen.xu@intel.com>
drivers/raw/ifpga/base/ifpga_fme_rsu.c