mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
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>
This commit is contained in:
parent
3911b19cac
commit
b283d6ba67
|
@ -183,8 +183,12 @@ static int CYC2_ps_load(Altera_desc *desc, const void *buf, size_t bsize)
|
||||||
else
|
else
|
||||||
puts("Fail.\n");
|
puts("Fail.\n");
|
||||||
#endif
|
#endif
|
||||||
(*fn->post) (cookie);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Run the post configuration function if there is one.
|
||||||
|
*/
|
||||||
|
if (*fn->post)
|
||||||
|
(*fn->post) (cookie);
|
||||||
} else {
|
} else {
|
||||||
printf("%s: NULL Interface function table!\n", __func__);
|
printf("%s: NULL Interface function table!\n", __func__);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user