raw/ifpga/base: check lseek failure
authorWei Huang <wei.huang@intel.com>
Wed, 17 Mar 2021 08:21:34 +0000 (04:21 -0400)
committerQi Zhang <qi.z.zhang@intel.com>
Thu, 1 Apr 2021 11:52:15 +0000 (13:52 +0200)
commit226ecdea99ce2ad4e1554b50fc7c2c4ca069191f
tree4d38e5f7d644b1c0a7bf1978476dea337133c641
parent13489381ccb11199e8e2029095db6bb829c5ab5e
raw/ifpga/base: check lseek failure

In write_flash_image(), calling function "lseek" without checking
return value has risk. Negative return value should be handled as
an error condition.

Coverity issue: 367478
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