summaryrefslogtreecommitdiff
path: root/drivers/bus/ifpga
diff options
context:
space:
mode:
authorRosen Xu <rosen.xu@intel.com>2018-05-22 18:26:18 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-05-22 19:16:26 +0200
commitbb5c82daa7d696dbac85b283a8bc82aa75e8ed96 (patch)
tree78f9db092075c58373aca20ea5d2f7a79a22ce3f /drivers/bus/ifpga
parent089818197459a899dbddc46c689a6fe53ecd5563 (diff)
downloaddpdk-bb5c82daa7d696dbac85b283a8bc82aa75e8ed96.zip
dpdk-bb5c82daa7d696dbac85b283a8bc82aa75e8ed96.tar.gz
dpdk-bb5c82daa7d696dbac85b283a8bc82aa75e8ed96.tar.xz
bus/ifpga: fix null pointer dereference in scan
Fix ifpga_scan_one() null pointer dereferences issue. Coverity issue: 279454 Fixes: 05fa3d4a6539 ("bus/ifpga: add Intel FPGA bus library") Cc: stable@dpdk.org Signed-off-by: Rosen Xu <rosen.xu@intel.com>
Diffstat (limited to 'drivers/bus/ifpga')
-rw-r--r--drivers/bus/ifpga/ifpga_bus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index db16173..b324872 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -159,7 +159,8 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
goto end;
strlcpy(afu_pr_conf.bs_path, path, sizeof(afu_pr_conf.bs_path));
- if (rawdev->dev_ops->firmware_load &&
+ if (rawdev->dev_ops &&
+ rawdev->dev_ops->firmware_load &&
rawdev->dev_ops->firmware_load(rawdev,
&afu_pr_conf)){
IFPGA_BUS_ERR("firmware load error %d\n", ret);