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>
diff --git a/drivers/fpga/cyclon2.c b/drivers/fpga/cyclon2.c
index ab979b0..c929cd2 100644
--- a/drivers/fpga/cyclon2.c
+++ b/drivers/fpga/cyclon2.c
@@ -183,8 +183,12 @@
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__);
}