raw/ifpga/base: check null pointer in PMCI
Do null-checking on hw->adapter in fme_pmci_init() before dereference it.
Coverity issue: 379202
Fixes: ca6eb0f7c8
("raw/ifpga/base: add PMCI base driver")
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
099da89792
commit
b6e029cfa4
@ -1591,7 +1591,7 @@ static int fme_pmci_init(struct ifpga_feature *feature)
|
|||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
hw = fme->parent;
|
hw = fme->parent;
|
||||||
if (!hw)
|
if (!hw || !hw->adapter)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
mgr = hw->adapter->mgr;
|
mgr = hw->adapter->mgr;
|
||||||
@ -1608,7 +1608,7 @@ static int fme_pmci_init(struct ifpga_feature *feature)
|
|||||||
|
|
||||||
max10->type = M10_N6000;
|
max10->type = M10_N6000;
|
||||||
max10->mmio = feature->addr;
|
max10->mmio = feature->addr;
|
||||||
if (hw->adapter && hw->adapter->shm.ptr) {
|
if (hw->adapter->shm.ptr) {
|
||||||
sd = (opae_share_data *)hw->adapter->shm.ptr;
|
sd = (opae_share_data *)hw->adapter->shm.ptr;
|
||||||
max10->bmc_ops.mutex = &sd->spi_mutex;
|
max10->bmc_ops.mutex = &sd->spi_mutex;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user