raw/ifpga/base: check adapter pointer before dereference
authorWei Huang <wei.huang@intel.com>
Thu, 5 Nov 2020 02:05:40 +0000 (21:05 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Nov 2020 15:26:54 +0000 (16:26 +0100)
commite6dc14c8008c1e559bd75a5c9eba4b39e0e07d33
treea4dee18fa17684507ee6f3590911505840226bc1
parent2414339cee422a1401a399ba225132dd1a49d34a
raw/ifpga/base: check adapter pointer before dereference

In opae_adapter_destroy(), pointer "adapter" is not validated before
passing it to opae_adapter_shm_free() and opae_adapter_mutex_close()
which dereference it.

Coverity issue: 363752
Fixes: e41856b515ce ("raw/ifpga/base: enhance driver reliability in multi-process")

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