fpi-ssm: Bug on handler set to a NULL function

We would crash otherwise, while this is quite obvious there was no code
enforcing this.
This commit is contained in:
Marco Trevisan (Treviño) 2019-11-28 20:15:21 +01:00
parent ff67bf5a16
commit b0effae990

View file

@ -114,6 +114,7 @@ fpi_ssm_new (FpDevice *dev,
FpiSsm *machine; FpiSsm *machine;
BUG_ON (nr_states < 1); BUG_ON (nr_states < 1);
BUG_ON (handler == NULL);
machine = g_new0 (FpiSsm, 1); machine = g_new0 (FpiSsm, 1);
machine->handler = handler; machine->handler = handler;