raw/ifpga/base: check null pointer
In init_sec_mgr(), pointer "hw" may be NULL, so "hw" should be checked before dereferencing. Coverity issue: 367483 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>
This commit is contained in:
parent
bf95921a01
commit
20077edf5f
@ -610,7 +610,7 @@ int init_sec_mgr(struct ifpga_fme_hw *fme)
|
|||||||
smgr->rsu_status = NULL;
|
smgr->rsu_status = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((hw->pci_data->device_id == IFPGA_N3000_DID) &&
|
if (hw && (hw->pci_data->device_id == IFPGA_N3000_DID) &&
|
||||||
(hw->pci_data->vendor_id == IFPGA_N3000_VID)) {
|
(hw->pci_data->vendor_id == IFPGA_N3000_VID)) {
|
||||||
smgr->ops = &n3000_sec_ops;
|
smgr->ops = &n3000_sec_ops;
|
||||||
smgr->copy_speed = IFPGA_N3000_COPY_SPEED;
|
smgr->copy_speed = IFPGA_N3000_COPY_SPEED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user