summaryrefslogtreecommitdiff
path: root/drivers/fpga
diff options
context:
space:
mode:
authorAlexander Dahl <ada@thorsis.com>2019-06-28 14:41:23 +0200
committerMichal Simek <michal.simek@xilinx.com>2019-07-30 10:21:15 +0200
commitb283d6ba67a7b4c5914949ef1d756bf88cb3a0e4 (patch)
tree036058118bae0f60cd3d2ffe1d5a977bb18476a3 /drivers/fpga
parent3911b19cac9dc7d11e7d9e79e80fb62eced74ba7 (diff)
fpga: altera: cyclon2: Check function pointer before calling
As already done for the 'pre' function, a check is added to not follow a NULL pointer, if somebody has not assigned a 'post' function. Signed-off-by: Alexander Dahl <ada@thorsis.com>
Diffstat (limited to 'drivers/fpga')
-rw-r--r--drivers/fpga/cyclon2.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/fpga/cyclon2.c b/drivers/fpga/cyclon2.c
index ab979b017a..c929cd2cc5 100644
--- a/drivers/fpga/cyclon2.c
+++ b/drivers/fpga/cyclon2.c
@@ -183,8 +183,12 @@ static int CYC2_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
else
puts("Fail.\n");
#endif
- (*fn->post) (cookie);
+ /*
+ * Run the post configuration function if there is one.
+ */
+ if (*fn->post)
+ (*fn->post) (cookie);
} else {
printf("%s: NULL Interface function table!\n", __func__);
}